How to remove coordinates from Googles Geo Charts tooltip

I added some markers to my map (using the Googles chart API)

data.addColumn('number', 'Lat'); data.addColumn('number', 'Long'); data.addColumn('number', 'Value'); data.addColumn({type:'string', role:'tooltip'}); data.addRows([ [48.1667,14.0333, 15, 'Tooltiptext'], [48.2000,14.0333, 25, 'Tooltiptext'], [48.2000,14.2333, 35, 'Tooltiptext'] ]); 

Here's what it looks like:

enter image description here

I would like to get rid of lat / long and replace it with Tooltiptext: {value}

+4
source share
1 answer

You can use this data structure, for example:

 google.visualization.DataTable(); data.addColumn('number', 'Lat'); data.addColumn('number', 'Long'); data.addColumn('string','tooltip'); data.addColumn('number','Example'); data.addColumn({type:'string', role:'tooltip'}); data.addRows([[41.151636,-8.569336,'Portugal',0,'test PT']]); data.addRows([[ 39.059575,-98.789062,'USA',1,'test US']]); 

Thus, the coordinates will not be displayed, and you will have 2 lines for a tooltip.

Check out the working example:

http://jsfiddle.net/cmoreira/q9Jzz/

+4
source

Source: https://habr.com/ru/post/1446424/


All Articles