0

Is this possible? I want the other slices in the pie chart to adjust to a full circle when one is disabled in the legend, rather than just making an empty slice..

Kyro
  • 627
  • 2
  • 6
  • 14

1 Answers1

3

If you change the behavior of the legendItemClick event handler you can remove the sector instead of hiding it.

    pie: {
         point: {
            events: {
                legendItemClick: function (eventArgs) {
                    this.remove(); // Remove the point
                    eventArgs.preventDefault(); // Prevent the default behavior
                }
            }
        },
        showInLegend: true
    }

This will only get you half the way though. The problem is that you cannot get the point back since it will be removed from the legend as well.

A way to get around this would be to add a reset button that brings back the original data set with series.setData(). See this jsfiddle example.

eolsson
  • 12,567
  • 3
  • 41
  • 43
  • Thanks, works for me, now I just have to figure out how to call that setData() function from within the php wrapper I'm using for Highcharts... – Kyro Nov 17 '11 at 18:28