Edit tooltips for GeoChart

39 views
Skip to first unread message

Yousef El-Khalili

unread,
Jun 22, 2016, 11:04:16 AM6/22/16
to Google Visualization API
I created a geo chart with the following code: 

     
      var data2 = google.visualization.arrayToDataTable([
        ['Province','Name','Percentage'  ],
        [ 'CA-ON','Ontario',eval('6319 / 256000 * 100')],
        ['CA-BC','British Columbia', eval('2150 / 102800 * 100')],
        ['CA-MB', 'Manitoba',eval('1088 / 23500 * 100')],
        ['CA-AB','Alberta',eval('3401 / 73000 * 100')],
        ['CA-NS','Nova Scotia' ,eval('1718 / 43600 * 100')],
        ['CA-PE','Prince Edward' ,eval('1080 / 4400 * 100')],
        ['CA-NB','New Brunswick',eval('1080 / 32200 * 100')],
        ['CA-SK', 'Saskatchewan',eval('1657 / 18300 * 100')],
        ['CA-YT','Yukon' ,1],
        ['CA-NT', 'Northern Territories',1],
        ['CA-NU','Nunavut',1],
        ['CA-NL', 'New Foundland',eval('614 / 15900 * 100')],
        ['CA-QC', 'Quebec',eval("3065 / 124100 * 100")]
      ]);


      datat2.setColumnProperty(2,'role','tooltip');

     var options2 = {
            region: 'CA',
            displayMode: '',
            resolution: 'provinces',
            colorAxis: {colors: c}
            };

           var chart2 = new google.visualization.GeoChart(document.getElementById('province_div'));
           chart2.draw(data2,options2);





To specify the provinces, I have to input them in their ISO format in the first column like "CA-ON" which is Ontario. But I don't want this to show on the tooltip. I looked around and found
the 
setColumnProperty

but it's still not working I want to display the Province name in full instead of the abbreviated ISO format.

Thanks.










David Schouten

unread,
Aug 13, 2016, 2:37:13 PM8/13/16
to Google Visualization API
Hi there,

Maybe this is a bit late but I was wondering if you have found a fix already. I am currently having the same problem that I want the top line to be different than the first column I gave. I've already figured out how to change the second line, but can't seem to get the top one working.

Thanks,
David

Op woensdag 22 juni 2016 17:04:16 UTC+2 schreef Yousef El-Khalili:
Reply all
Reply to author
Forward
0 new messages