Home Forums Report Bugs Legend Click on Pie

Legend Click on Pie

Viewing 5 posts - 1 through 5 (of 5 total)
  • #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/

    Cheers,
    Cristi

    #15545

    Cristi,

    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

    #15547

    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.

    Thanks,
    Cristi

    • This reply was modified 7 years, 3 months ago by Cristi S..
    • This reply was modified 7 years, 3 months ago by Cristi S.. Reason: added example
    #15563

    Cristi,

    You can achieve this by using itemclick in legend.

    Please take a look at this work-around

    #15568

    Brilliant! Thanks, Indranil.

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

You must be logged in to reply to this topic.