Hi,

I'm using Geochart for a website I'm developing.
Currently I list countries on a couple of maps, like this: 

    ['Countries', 'Link', 'Offices'],
    ['Czech Republic', '/europe', 1],

For one specific map I would like to select whole continents, but I can't 
figure out how to do this. 
Can you help me? Thanks! Underneath you find all of the code I'm using 
right now.

Kind Regards,
Pier

----

<div id="chart"> </div>
<div>
<script type="text/javascript" src="https://www.google.com/jsapi";></script>
<script type="text/javascript">// <![CDATA[
google.load('visualization', '1', {'packages': ['geochart']});
google.setOnLoadCallback(drawRegionsMap);

function drawRegionsMap () {
var data = google.visualization.arrayToDataTable([

    ['Countries', 'Link', 'Offices'],
    ['USA', '/north-america', 1],
    ['Canada', '/north-america', 1],
    ['Slovakia', '/europe', 1],
    ['Czech Republic', '/europe', 1],
    ['Bulgaria', '/europe', 1],
    ['Croatia', '/europe', 1],
    ['Hungary', '/europe', 1],
    ['Poland', '/europe', 1],
    ['Romania', '/europe', 1],
    ['Slovenia', '/europe', 1],
    ['Serbia', '/europe', 1],

  ]);

var view = new google.visualization.DataView(data)
view.setColumns([0, 2])

var height = ( $(window).width() / 5 ) * 3;
  var geochart = new 
google.visualization.GeoChart(document.getElementById('chart'));
  geochart.draw( view, {
    width: $(window).width(),
    height: height,
    region: 'world', 
    legend: 'none',
    keepAspectRatio: false,
    backgroundColor: '#d9e8f5',
    colorAxis: {colors: ['#6E90CF', '#005ca9']}
  } );

$('#chart').css({ top: -1 * ( height / 4 ) })
$('#page-header').height( height - ( height / 4 ) )

function selectHandler(e)     {   
   window.location = data.getValue(geochart.getSelection()[0].row, 1);
}
        google.visualization.events.addListener(geochart, 'select', 
selectHandler);
}
// ]]></script>
</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