You must be logged in to post your query.
Home › Forums › Report Bugs › Legend Click on Pie
Tagged: ItemClick, legend, pie
A click on a legend item, for a pie, will hide or show ALL data series. It will either hide or render the whole pie.
To repro, copy and paste the itemclick event from Hide Unhide Data Series on Legend Click into a Pie chart like this one. Or take a look at my fiddle: http://jsfiddle.net/cristiscu/so6ao1gn/1/
As of now, visible property is applicable only at dataSeries level. However, in pie and doughnut charts, the legends are shown for individual dataPoints rather than dataSeries. In your fiddle, you are hiding the entire dataSeries of pie chart, so the entire chart gets hidden.
Instead, on legend click, you can manipulate the dataPoints and render the chart as per your requirement.
You’re right, Suyash, pie/doughnut charts are single series.
Given this is a common requirement (many competitors implement this feature as built-in, see an example), I would truly appreciate a working sample, if you have better knowledge on how to manipulate those dataPoints. I tried without success.
You can achieve this by using itemclick in legend.
Please take a look at this work-around
Brilliant! Thanks, Indranil.
You must be logged in to reply to this topic. Login/Register