Home forums Report Bugs Legend Click on Pie

Tagged: , ,

This topic contains 4 replies, has 3 voices, and was last updated by  Cristi S. 2 years, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #15542

    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.
    Suyash Singh
    Team CavasJS


    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.


    • This reply was modified 2 years, 4 months ago by  Cristi S..
    • This reply was modified 2 years, 4 months ago by  Cristi S.. Reason: added example


    You can achieve this by using itemclick in legend.

    Please take a look at this work-around


    Brilliant! Thanks, Indranil.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.