Pie chart ItemLegendClick Event not working properly.

May 7, 2013 at 7:50 PM
I noticed that on charts, other than pie, if you clicked on an item in the legend it would disappear and the chart would refresh no longer showing that data. On the pie chart however the slice disappears but just leave and empty slice. The pie does not refresh and readjust. I tried adding the code below to see if the event could be accessed.
Pie = new PlotOptionsPie
            {
                
               

                
                Animation = new Animation(true),
                ShowInLegend = true,
                AllowPointSelect = true,
                Cursor = Cursors.Pointer,
                Events = new PlotOptionsPieEvents
                {

                    Click = "function(event) { alert('blahblah'); }",
                    LegendItemClick = "function(event) { alert('blahblah'); }",
                    
                },
The click event works however the legend click does not.
Coordinator
May 26, 2013 at 11:32 PM
In the summary of the property PlotOptionsPieEvents.LegendItemClick is written:
Not applicable to pies, as the legend item is per point. See point.events.
Therefore you should use the property PlotOptionsPiePointEvents.LegendItemClick:
Pie = new PlotOptionsPie
                    {
                        Animation = new Animation(true),
                        ShowInLegend = true,
                        AllowPointSelect = true,
                        Cursor = Cursors.Pointer,
                        Events = new PlotOptionsPieEvents { Click = "function(event) { alert('The slice was clicked!'); }" },
                        Point = new PlotOptionsPiePoint { Events = new PlotOptionsPiePointEvents { LegendItemClick = "function(event) { if (!confirm('Do you want to toggle the visibility of this slice?')) { return false; } }" } }
                    }