本文介绍了如何制作甜甜圈图表可点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想制作可点击的圆环图。如果我点击一个切片它应该朝下一页(如url(a href)。
我尝试过:
我试过编码。但这只适用于高亮条。
I want to make donut chart clickable. If i click on one slice it should take towards next page(like url(a href).
What I have tried:
I have tried to code. but this is only for highlight bar.
Highcharts.chart('container', {
chart: {
type: 'column'
},
title: {
text: 'Click points to go to URL'
},
xAxis: {
type: 'category'
},
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
click: function () {
location.href = 'https://en.wikipedia.org/wiki/' +
this.options.key;
}
}
}
}
},
series: [{
data: [{
y: 29.9,
name: 'USA',
key: 'United_States'
}, {
y: 71.5,
name: 'Canada',
key: 'Canada'
}, {
y: 106.4,
name: 'Mexico',
key: 'Mexico'
}]
}]
});
推荐答案
这篇关于如何制作甜甜圈图表可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!