Or you can set it directly on the table:
data.setColumnProperty(4, 'role', 'tooltip');
On Friday, August 23, 2013 2:54:06 PM UTC-4, Brian wrote:
>
> Fantastic, thanks!
>
> On Friday, August 23, 2013 2:45:23 PM UTC-4, Sergey wrote:
>>
>> In order for it to work, it needs to have the role 'tooltip'. There's
>> currently no way to set that from docs, but there is a way to do it in
>> view.setColumns. This worked for me:
>>
>> view.setColumns([0,1,2,3,{sourceColumn: 4, role: 'tooltip'}]);
>>
>> - Sergey
>>
>>
>> On Fri, Aug 23, 2013 at 2:34 PM, Brian <[email protected]>wrote:
>>
>>> I'm trying to generate this
>>> map<http://thecookblog.com/maps/testMap.html>from this
>>> spreadsheet<https://docs.google.com/spreadsheet/ccc?key=0Aubbnlbl2W3ZdG9wOE1odF9RbUJrR1JXOUQ4Q3hvUlE>.
>>>
>>> I've nearly got it working how I want, but the last problem I'm unable to
>>> solve is how to show data from the Secondary Text column on the second line
>>> of the tooltip, rather than the value. I've got a view set up, but if I try
>>> to show column 4 rather than column 3, I get the "too many columns" error.
>>> Would love some help on this!
>>>
>>> google.load('visualization', '1', {packages: ['geochart']});
>>>
>>> function drawVisualization() {
>>> var query = new google.visualization.Query('
>>> https://docs.google.com/spreadsheet/ccc?key=0Aubbnlbl2W3ZdG9wOE1odF9RbUJrR1JXOUQ4Q3hvUlE'
>>> );
>>> query.send(handleQueryResponse);
>>> }
>>>
>>> function handleQueryResponse(response) {
>>> if (response.isError()) {
>>> alert('Error in query: ' + response.getMessage() + ' ' +
>>> response.getDetailedMessage());
>>> return;
>>> }
>>>
>>>
>>> var data = response.getDataTable();
>>>
>>> var view = new google.visualization.DataView(data);
>>> view.setColumns([0,1,2,3]);
>>>
>>> visualization = new
>>> google.visualization.GeoChart(document.getElementById('visualization'));
>>> visualization.draw(view, options);
>>> }
>>>
>>> var options = {
>>> region: 'US',
>>> resolution: 'provinces',
>>> height: 500,
>>> width: 700,
>>> legend: 'none',
>>> sizeAxis: { minSize: 6, maxSize: 6 },
>>> colorAxis: { minValue: 1, maxValue: 2, colors:
>>> ['#444444','#fb4f14']}
>>> }
>>>
>>> google.setOnLoadCallback(drawVisualization);
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Visualization API" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at
>>> http://groups.google.com/group/google-visualization-api.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.