Skip to content Skip to sidebar Skip to footer

Highlight Continent With Mouseover Using Google Visualization Api Geocharts

I have following code and I expect that when I have mouseover that a continent it should highlight that continent: I tried this code but I did not got that working google.maps.even

Solution 1:

In order to highlight continents, you will have to set the resolution option to 'continents'. This is incompatible with using country-level data, however.

Solution 2:

This code should help:

google.setOnLoadCallback(drawRegionsMap);

functiondrawRegionsMap() {

  var data = google.visualization.arrayToDataTable([
      ['Region Code', 'Continent', 'Popularity'],
      ['142', 'Asia', 200],
      ['150', 'Europe', 300],
      ['019', 'Americas', 400],
      ['009', 'Oceania', 600],
      ['002', 'Africa', 700]
  ]);

  var options = {
      resolution: 'continents'
  };

  var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));

  chart.draw(data, options);
}

Post a Comment for "Highlight Continent With Mouseover Using Google Visualization Api Geocharts"