Pie chart click event

Oystein Bjorke fa 6 anys 0
This discussion was imported from CodePlex

tbnguyen1407 wrote at 2013-05-02 10:30:


Does the pie series fire MouseUp/MouseDown event? Those events do not seem to trigger when I click on the slices.
PieSeries pieSeries = new PieSeries();
pieSeries.Slices = listOfPieSlices; // populate

pieSeries.MouseDown += (o, args) =>
    // handle mousedown event - never trigger here

objo wrote at 2013-05-06 10:39:

Sorry, the mouse events are not yet supported by the PieSeries.

But it should be quite easy to implement:
  1. store the polygons in the PieSeries.Render method in a private field
  2. in the PieSeries.GetNearestPoint method, check if the point is inside any of these polygons (use ScreenPointHelper.IsPointInPolygon)
    see a similar implementation in the BarSeriesBase and return a TrackerHitResult
If you or someone else want to make a pull request for this issue, remember to include an example!