当我点击某个州时,如何隐藏该州的特定饼图? 例如在这张 map 上:
series: [{
mapData: Highcharts.maps['countries/us/us-all'],
data: data,
name: 'States',
....
events: {
click: function (e) {
e.point.zoomTo();
chart.update({
-- hide the state's pie
-- display data from serie on this specific state
})
}
}
我想隐藏加利福尼亚州的饼图并放大该州以显示其他一系列数据(例如点)...
非常感谢您的帮助!
最佳答案
您需要找到正确的系列并使用setVisible
方法:
events: {
click: function(e) {
e.point.zoomTo();
Highcharts.find(chart.series, function(item) {
return item.name === e.point.id;
}).setVisible(false, false);
}
}
现场演示:https://jsfiddle.net/BlackLabel/czav0kL3/
API:https://api.highcharts.com/class-reference/Highcharts.Series#setVisible
关于javascript - Highchart map 饼图 : clic and hide specific pie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53726393/