Wednesday 18 December 2013

5 State Data in Google GeoChart

In this map, we use data from States ( see the spreadsheet ) and this too can be mapped into a map of India. However state level maps are not available and the data for a particular state is mapped into a point ( or marker) in the state.

Once again we observe the limitations of not being able to show more than two data points for each state.

    <script type='text/javascript' src=''></script>
    <script type='text/javascript'>
     google.load('visualization', '1', {'packages': ['geochart']});
    function drawMarkersMapTR() {
            var query = new google.visualization.Query(
      query.setQuery('select B,C,D'); 
    function handleQueryResponseTR(response) {
  if (response.isError()) {
    alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
  var options = {
        region: 'IN',
        displayMode: 'markers', 
        width : 600,
        height : 400

  var data = response.getDataTable();
  var chart = new google.visualization.GeoChart(document.getElementById('chart_divTR'));
  chart.draw(data, options );

    <div id="chart_divTR"></div>

No comments:

Post a Comment