我有这个geochart:https://jsfiddle.net/y2dkrpg1/ 是否可以添加关于每个区域的一些添加信息(文本)(例如通过单击该区域)?
谢谢!
google.load('visualization', '1', {'packages': ['geochart']});
google.setOnLoadCallback(drawMarkersMap);
function drawMarkersMap() {
var data = google.visualization.arrayToDataTable([
['State', 'NS'],
['Blagoevgrad', 17],
['Burgas', 15],
['Varna', 27],
['Veliko Tarnovo', 24],
['Vidin', 30],
['Vratsa', 35],
['Gabrovo', 30],
['Dobrich', 37],
['Kardzhali', 23],
['Kyustendil', 17],
['Lovech', 20],
['Montana', 49],
['Pazardjik', 31],
['Pernik', 26],
['Pleven', 24],
['Plovdiv', 28],
['Razgrad', 25],
['Ruse', 28],
['Silistra', 49],
['Sliven', 17],
['Smolyan', 25],
['Sofia', 28],
['Stara Zagora', 20],
['Targovishte', 30],
['Haskovo', 40],
['Shumen', 40],
['Yambol', 30],
['Pazardzhik', 31],
['Sofia-grad', 12],
]);
var formatter = new google.visualization.NumberFormat({
fractionDigits: 0,
suffix: '%'
});
formatter.format(data, 1);
var options = {
region: 'BG',
displayMode: 'regions',
resolution: 'provinces',
};
var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
chart.draw(data, options);
};
答案 0 :(得分:0)
写一些东西而不是Tadam'和价值观。
google.load('visualization', '1', {'packages': ['geochart']});
google.setOnLoadCallback(drawMarkersMap);
function drawMarkersMap() {
var data = google.visualization.arrayToDataTable([
['State', 'NEETs','TADAM'],
['Blagoevgrad', 17, 100],
['Burgas', 15, 100],
['Varna', 27, 6],
['Veliko Tarnovo', 24, 34],
['Vidin', 30, 324],
['Vratsa', 35, 234],
['Gabrovo', 30, 32423],
['Dobrich', 37, 5],
['Kardzhali', 23, 5],
['Kyustendil', 17, 5],
['Lovech', 20, 345],
['Montana', 49, 43534],
['Pazardjik', 31, 34534],
['Pernik', 26, 34534],
['Pleven', 24, 3443],
['Plovdiv', 28, 34],
['Razgrad', 25, 100],
['Ruse', 28, 10],
['Silistra', 49, 1],
['Sliven', 17, 2],
['Smolyan', 25, 3],
['Sofia', 28, 4],
['Stara Zagora', 20, 5],
['Targovishte', 30, 6],
['Haskovo', 40, 7],
['Shumen', 40, 8],
['Yambol', 30, 9],
['Pazardzhik', 31, 10],
['Sofia-grad', 12, 11],
]);
var formatter = new google.visualization.NumberFormat({
fractionDigits: 0,
suffix: '%'
});
formatter.format(data, 1);
var options = {
region: 'BG',
displayMode: 'regions',
resolution: 'provinces',
};
var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
chart.draw(data, options);
};