Venkatesh K H

Venkatesh K H

  • NA
  • 116
  • 33.2k

How to make donut chart clickable

Jul 12 2017 5:19 AM
I want to make donut chart clickable. If i click on one slice it should take towards next page(like url(a href).
 
I have tried this code but it doesnt work for donuts chart.
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'
}]
}]
}); 

Answers (1)