I'm a newbie in this community so I'll try my best. I'm trying to perform a drilldown using Highcharts in a pie chart. The fact is that I want to develop some code that allows me to:
- In a first click select multiple charts (or slices from a pie)
- In a second click drilldown the pie to view the drilldown series.
Here it goes with my code (where I can only perform multiple selections when the drilldown is done, not before):
$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'pie'
},
plotOptions: {
series: {
point: {
events: {
click: function (event) {
this.slice(null);
}
}
}
}
},
series: [{
name: 'Things',
colorByPoint: true,
data: [{
name: 'Animals',
y: 5,
drilldown: 'animals'
}, {
name: 'Fruits',
y: 2,
drilldown: 'fruits'
}, {
name: 'Cars',
y: 4,
drilldown: 'cars'
}]
}],
drilldown: {
series: [{
id: 'animals',
data: [
['Cats', 4],
['Dogs', 2],
['Cows', 1],
['Sheep', 2],
['Pigs', 1]
]
}, {
id: 'fruits',
data: [
['Apples', 4],
['Oranges', 2]
]
}, {
id: 'cars',
data: [
['Toyota', 4],
['Opel', 2],
['Volkswagen', 2]
]
}]
}
});
});
Thanks for your help mates!