解决方法
您还可以通过按摩数据并使用标签的格式化值来解决此问题.您应该能够将以下代码粘贴到
here中以查看示例:
function drawVisualization() { var geoData= new google.visualization.DataTable(); geoData.addRows(2); geoData.addColumn('string','State'); geoData.addColumn('number','Votes (%)'); geoData.setValue(0,'Alabama'); geoData.setValue(0,1,0); geoData.setFormattedValue(0,'56%'); geoData.setValue(1,'Maine'); geoData.setValue(1,1); geoData.setFormattedValue(1,'64%'); var options = {}; options['region'] = 'US'; options['resolution'] = 'provinces'; options['colorAxis'] = { minValue : 0,maxValue : 1,colors : ['#FF0000','#0000FF']}; options['backgroundColor'] = '#FFFFFF'; options['datalessRegionColor'] = '#E5E5E5'; options['width'] = 556; options['height'] = 347; options['legend'] = 'none'; var geochart = new google.visualization.GeoChart( document.getElementById('visualization')); geochart.draw(geoData,options); }