When I plug that into the 
playground<https://code.google.com/apis/ajax/playground/?type=visualization#geo_chart>
 all 
I get is "google.setOnLoadCallback(drawVisualization);"

On Wednesday, April 3, 2013 5:45:25 PM UTC-4, asgallant wrote:
>
> You want to set up the 3rd column as a "tooltip" role column, like this:
>
> var data = new google.visualization.DataTable();
> data.addColumn('string', 'State', 'State');
> data.addColumn('number', 'rank', 'rank');
> data.addColumn({type: 'string', label: 'branch', id: 'branch', role: 
> 'tooltip'});
> data.addRows([            
>     ['Alabama', 1, 'Air Force: 4 KW'],
>     ['Alaska', 2, 'Air Force: 30 KW'],
>     ['Arizona', 3, 'Air Force: 1156 KW'],
>     //...
> ]);
>
> On Wednesday, April 3, 2013 5:30:41 PM UTC-4, Susanna Murley wrote:
>>
>> I would like to show a map of the US that colors states based on their 
>> rank in a datatable and displays the name of the state and some text in the 
>> tooltip. Here's my code. There's an error in here somewhere, but I'm not 
>> sure where. 
>>
>>
>> <script type="text/javascript" src="http://www.google.com/jsapi";></script
>> ><script type="text/javascript">
>>     google.load('visualization', '1', {packages: ['geochart']});
>>     
>>     function drawVisualization() {
>>            data.addColumn('string',  'State', 'State');
>>            data.addColumn('number', 'rank', 'rank');
>>            data.addColumn('string', 'branch','branch');
>>            data.addRows([            
>>             ['Alabama', 1, 'Air Force: 4 KW'],
>>             ['Alaska', 2, 'Air Force: 30 KW'],
>>             ['Arizona', 3, 'Air Force: 1156 KW'],
>>         ]);
>>
>>        
>>         
>>         var geochart = new google.visualization.GeoChart(document.
>> getElementById('visualization'));
>>         var options = {};
>>         options['region'] = 'US';
>>         options['resolution'] = 'provinces';
>>         options['width'] = 620;
>>         options['height'] = 368;
>>         options['colorAxis'] = {minValue: 0,  colors: ['#ddeef8', 
>> '#0078c0', '#80b452', '#ffe04e', '#f8931f', '#d54215']}
>>
>>    
>>     
>>         geochart.draw(data, options);
>>     }
>>     
>>
>>     google.setOnLoadCallback(drawVisualization);
>>   </script><div id="visualization">&nbsp;</div>
>>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to