- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在 Google GeoCharts 中按国家/地区显示记录计数。
然而,我们的国家分组与 GeoCharts 使用的不同。
例如,谷歌使用联合国的:
<shakefist at="Microsoft">Argh!</shakefist>
最佳答案
不幸的是,不,你不能。您可以选择美洲、北美洲、加勒比海或南美洲,但不能选择“拉丁美洲”。您可以做的是创建一个缩放 map ,在其中显示美国,然后单击即可放大某个区域。您实际上需要拥有国家/地区数据和地区数据,或者如果您愿意,只需拥有标记数据,但这里有一个单击以进行缩放的示例:
<!--
You are free to copy and use this sample in accordance with the terms of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Google Visualization API Sample</title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', {packages: ['geochart']});
var width, height, selectedRegion, resolution;
window.onload = function(){
width = 556;
height = 400;
selectedRegion = 'world';
resolution = 'subcontinents';
};
function drawVisualization() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Region');
data.addColumn('number', 'Value');
data.addRows([
[{v:"005", f:"South America"}, 978.7],
[{v:"011", f:"Western Africa"}, 46],
[{v:"013", f:"Central America"}, 299],
[{v:"014", f:"Eastern Africa"}, 63.9],
[{v:"015", f:"Northern Africa"}, 255.7],
[{v:"017", f:"Middle Africa"}, 21.4],
[{v:"018", f:"Southern Africa"}, 244.5],
[{v:"029", f:"Caribbean"}, 76.5],
[{v:"030", f:"Eastern Asia"}, 5712.9],
[{v:"034", f:"Southern Asia"}, 1275.1],
[{v:"035", f:"South-Eastern Asia"}, 639.2],
[{v:"039", f:"Southern Europe"}, 777.8],
[{v:"053", f:"Australia and New Zealand"}, 272],
[{v:"054", f:"Melanesia"}, 6.3],
[{v:"057", f:"Micronesia"}, 1.8],
[{v:"061", f:"Polynesia"}, 1],
[{v:"143", f:"Central Asia"}, 170.3],
[{v:"145", f:"Western Asia"}, 834.1],
[{v:"151", f:"Eastern Europe"}, 1587.6],
[{v:"154", f:"Northern Europe"}, 801.5],
[{v:"155", f:"Western Europe"}, 1456.2],
[{v:"021", f:"Northern America"}, 4704.1]
]);
var options = {
displayMode: 'regions',
enableRegionInteractivity: 'true',
resolution: resolution,
region: selectedRegion,
height: height,
width: width
};
var geochart = new google.visualization.GeoChart(
document.getElementById('visualization'));
google.visualization.events.addListener(geochart, 'select', function() {
var selection = geochart.getSelection();
if (selection.length == 1) {
var selectedRow = selection[0].row;
selectedRegion = data.getValue(selectedRow, 0);
resolution = "countries";
options.region = selectedRegion;
options.resolution = resolution;
//alert(resolution);
geochart.draw(data, options);
}
});
geochart.draw(data, options);
}
google.setOnLoadCallback(drawVisualization);
</script>
</head>
<body style="font-family: Arial;border: 0 none;">
<div id="visualization"></div>
</body>
</html>
关于data-visualization - 用户在 Google Charts 中指定的地区和国家集合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14257135/
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
在我的 MVC 应用程序中,我想显示用户访问网站的国家/地区、地区和城市。我怎样才能获取它们? 最佳答案 有几种方法。一种是要求用户与远程服务器共享他的位置。 https://developer.mo
有人知道Firebase电话身份验证是否适用于印度电话号码吗? 我成功实现并使用了美国号码(+1xxxxxxxxxx),但是尝试使用印度电话号码时未收到文本。不确定是否无法正常工作,或者我丢失了某些东
我想知道网站的原始国家/地区。我注意到Alexa网站通常可以检测网站的原始国家/地区。例如,Alexa可以检测到stackoverflow.com网站的原始国家/地区是美国,依此类推。 Alexa如何
我有一些文本,其中可能包含也可能不包含国家/地区名称。例如: ' Nigeria: Hotspot Network LTD Rural Telephony Feasibility Study' 这就是
已关闭。这个问题是 off-topic 。目前不接受答案。 想要改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 已关闭10 年前。 Improve th
我有一组值,它们是我的 ajax 调用中的国家/地区代码 Handler.getCountryIdparam1, {callback:function(data){ // data will
我在我的应用程序中使用谷歌地点。一切正常,但我只想从输入中删除或忽略国家/地区。 例如,如果输入“arc”我有 Arcachon, France Arcueil, France Archamps, F
在 firebase 中创建项目时,我错误地选择了错误的国家/地区。 正如您在这里看到的: 这个问题可以解决吗? (我知道项目 ID 无法更改,而且我喜欢我选择的 ID...) 最佳答案 如the d
我有一个名为“Login”的Hive表。它包含以下列: UserID | UserName | UserIP | UserCountry | Date 在特定的一天(当天的所有登录信息),我想找出用户
我正在使用谷歌地图和地理编码API来检索用户输入邮政编码/邮政编码后的纬度/经度,但我想将邮政编码/邮政编码限制为该用户所在的国家/地区,这样我就不会得到结果多个结果。 是否有一种方法可以使用 jqu
是否可以获得维基百科上所有有关系的国家、地区和城市的列表?我找不到任何适合此任务的 API。解析我需要的所有信息的最简单方法是什么?PS:我知道,我可以从其他数据源获取此信息。但我对维基百科感兴趣..
我正在用两种语言制作一个网站。是否可以检查用户位于哪个国家,以便我可以自动为用户切换语言?我的菜单中还有一个带有 _GET 的切换选项。我一开始有这段代码: if (isset($_GET['taal
这是我的 Firebase 数据库结构: 看起来就是这样。有国家和用户。如果用户访问过某个国家/地区,则该国家/地区将存储在该用户的“VisitedCountries”子项中。例如用户 Angelin
这个问题在这里已经有了答案: Convert latitude and longitude coordinates to country name in R (2 个回答) 关闭9年前. 我有一个带有
我目前正在开发我的第一个iOS应用(phonegap / cordova)。我想知道是否需要采取某些步骤,以使其不仅可用于德国应用程序商店(这是我的语言),还可以提供给国际应用程序? 最佳答案 不,你
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
背景 我目前正在开发一个向用户提问的 Android 应用程序。目前我正在创建用于提问的模块。现在我正在开发一个地形模块,它将能够向用户询问有关某个国家/地区的各种问题,并向他们显示。 问题 对于本模
我正在使用 Cloudera 的 TwitterSource for Flume。我想按国家/地区获取具有某些关键字的推文。当我想获取来自荷兰的推文时,我不知道该与什么进行比较。我有以下结果,但没有任
大多数 Web 应用程序都有一个位置字段,用户可以在其中输入自己选择的位置。 如何根据输入的位置将用户分类到不同的国家/地区。 例如,我使用了 users.xml 的 Stack Overflow 转
我是一名优秀的程序员,十分优秀!