如何使用js / geomap绘制不同颜色的每个城市?

时间:2014-03-31 21:09:48

标签: javascript html geomap

我有这个非常简单的代码:

https://gist.github.com/ndemir/9902237

http://jsfiddle.net/3PydS/

 <html>
   <head>
     <script type='text/javascript' src='http://www.google.com/jsapi'></script>
     <script type='text/javascript'>
       google.load("visualization", "1", {packages:["geomap"]});
       google.setOnLoadCallback(drawChart_ucGChart_chart_div); 
       function drawChart_ucGChart_chart_div() {
       var data = new google.visualization.DataTable();
       data.addColumn('string', 'City');
       data.addColumn('number', 'Popularity'); 
       data.addRows([
         ["TR-35", 75],
         ["TR-33", 34]
       ]); 
       var options = {
       "height":500,
       "width":800,
       "dataMode":"regions",
       "region":"TR",
       "colors": [0xFF8747, 0xFFB581, 0xc06000] //orange colors
     } 
    var chart = new google.visualization.GeoMap(map_canvas);
    chart.draw(data, options); return chart;
  }

</script>

             

我想用不同的颜色绘制每个城市,怎么做?

0 个答案:

没有答案