解決方案對於每個點
1>對於工具提示,您必須使用格式化程序
tooltip: {
formatter: function() {
return 'submissionDate: <b>' + this.point.submissionDate + '</b><br/>' +
'submissionResponseDate: <b>' + this.point.submissionResponseDate + '</b><br/>' +
'stateResponse: <b>' + this.point.stateResponse + '</b><br/>'
}
},
包含色彩
var data = [{
"hc-key": "us-ca",
"submissionDate": "05/20/2017",
"submissionResponseDate": "06/20/2017",
"stateResponse": "Approved",
"color": "#C40401",
}, {
"hc-key": "us-or",
"submissionDate": "05/20/2017",
"submissionResponseDate": "",
"stateResponse": "Approval Pending",
"color": "#0200D0"
}];
3>如您在樣本圖像顯示
2>準備JSON數據,你要默認的顏色其不在JSON.So爲此,你必須串聯使用nullColor: 'grey',
。
series: [{
allAreas: true,
data: data,
mapData: Highcharts.maps['countries/us/us-all'],
joinBy: 'hc-key',
//name: 'Random data',
nullColor: 'grey', //add this to color default area
states: {
hover: {
color: '#BADA55'
}
},
dataLabels: {
enabled: true,
format: '{point.name}'
}
}, {
name: 'Separators',
type: 'mapline',
data: Highcharts.geojson(Highcharts.maps['countries/us/us-all-all'], 'mapline'),
color: 'black',
showInLegend: false,
enableMouseTracking: false
}]
Fiddle示範
您可以使用Mike Zavarello提及的項目#2。如果您無法修改JSON數據 –
Hi @Deep感謝您的關注。正如我們已經將Highcharts.maps ['countries/us/us-all-all作爲json,像RI,DC這樣的一些州。我們如何將這些狀態的名稱放在原型中顯示?該地圖也不包含美國地區。 2)是否可以提供數字以及圖例來說明每個狀態下有多少州例如批准/待決? –
嗨檢查這個http://fiddle.jshell.net/yfpr9vL7/ –