I\'m trying to draw multiple pie-charts in the same chart with HighCharts
.
JSFIDDLE DEMO
I have enabled the legend for each pi
I have added the below code to detect the legend item clicked.
function(chart) {
$(chart.series[0].data).each(function(i, e) {
e.legendItem.on('click', function(event) {
var legendItem=e.name;
event.stopPropagation();
$(chart.series).each(function(j,f){
$(this.data).each(function(k,z){
if(z.name==legendItem)
{
if(z.visible)
{
z.setVisible(false);
}
else
{
z.setVisible(true);
}
}
});
});
});
});
}
Here is the jsfiddle