GoogleChart GeoChart - 法国地区地图? [英] GoogleChart GeoChart - French region map?
问题描述
我想用GeoChart显示法国地区的地图。
https://developers.google.com/chart/interactive/docs/gallery/geochart#regions-mode-format
在前面的链接中提到的ISO 3166代码是,例如,普罗旺斯 - 阿尔卑斯 - 科特迪瓦省的 FR-U
d'Azur地区。
https://en.wikipedia.org/wiki/Provence-Alpes-C%C3%B4te_d 'Azur
以下是我的选项:
var options = {
region:'FR-U',
displayMode:'markers',
colorAxis:{颜色:['green','blue']}
};
然而这不起作用。我收到以下错误消息:请求的映射不存在。
。这不是由于我的代码,因为如果我把 FR
而不是 FR-U
,它可以正常工作。
地图是否存在?
您引用的链接是 数据格式 区域图
region
接受以下内容...
'world'
- Geochart of整个世界。
一个大陆或亚洲大陆,由其3位代码指定,例如西非的'011'。
一个国家,由其ISO 3166-1 alpha-2代码指定,例如澳大利亚的AU。
美国的一个州,由其ISO 3166-2:美国代码指定,例如,用于阿拉巴马州的US-AL。请注意,解决方案选项必须设置为省或metros。
请参阅法国以下示例...
请注意分辨率
google.charts.load('current',{callback:function(){new google.visualization.GeoChart(document.getElementById('chart_div'))。draw(google.visualization.arrayToDataTable [['Destination','Popularity'],['FR-A',100],['FR-B',105],['FR-C',110],['FR-P',115] ,''FR-D',120],['FR-E',125],['FR-F',130],['FR-G',140],['FR- ,['FR-I',160],['FR-Q',175],['FR-J',190],['FR-K',215] , ['FR-M',255],['FR-N',280],['FR-O',305],['FR-R',335],['FR-S',365] ['FR-T',400],['FR-U',440],['FR-V',480],]),{colorAxis:{colors:['green','blue']} displayMode:'regions',region:'FR',resolution:'provinces'}); },packages:['geochart']}); < script src =https://www.gstatic.com/charts/loader.js>< / script>< div id =chart_div>< / div>
I want to display a map of a region of France with GeoChart.
https://developers.google.com/chart/interactive/docs/gallery/geochart#regions-mode-format
The ISO 3166 code mentionned in the previous link is, for example, FR-U
for the Provence-Alpes-Côte d'Azur region.
https://en.wikipedia.org/wiki/Provence-Alpes-C%C3%B4te_d'Azur
Here's my options:
var options = {
region: 'FR-U',
displayMode: 'markers',
colorAxis: {colors: ['green', 'blue']}
};
However this does not works. I'm getting the following error message: Requested map does not exist.
. This is not due to my code since if I put FR
instead of FR-U
it works fine.
Is the map simply not existing?
the link you reference is the Data Format for a Regions chart
and is separate from the Configuration Options
the option for region
accepts the following...
'world'
- A geochart of the entire world.A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa.
A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia.
A state in the United States, specified by its ISO 3166-2:US code, e.g., 'US-AL' for Alabama. Note that the resolution option must be set to either 'provinces' or 'metros'.
see following example for France...
note the resolution
google.charts.load('current', {
callback: function () {
new google.visualization.GeoChart(document.getElementById('chart_div')).draw(
google.visualization.arrayToDataTable([
['Destination', 'Popularity'],
['FR-A', 100],
['FR-B', 105],
['FR-C', 110],
['FR-P', 115],
['FR-D', 120],
['FR-E', 125],
['FR-F', 130],
['FR-G', 140],
['FR-H', 150],
['FR-I', 160],
['FR-Q', 175],
['FR-J', 190],
['FR-K', 215],
['FR-L', 235],
['FR-M', 255],
['FR-N', 280],
['FR-O', 305],
['FR-R', 335],
['FR-S', 365],
['FR-T', 400],
['FR-U', 440],
['FR-V', 480],
]),
{
colorAxis: {colors: ['green', 'blue']},
displayMode: 'regions',
region: 'FR',
resolution: 'provinces'
}
);
},
packages:['geochart']
});
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>
这篇关于GoogleChart GeoChart - 法国地区地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!