1

I would like to select points in a Polar chart in MSChart.
I have the ChartAreas.CursorX(and Y).IsUserSelection = true. But when I try to select a zone, the SelectionChanged event does not activate, nor do I see a selection in the chart.

digEmAll
  • 56,430
  • 9
  • 115
  • 140

1 Answers1

1

No, looking at the inner code of mschart, the cursors user selection is inhibited when the chart area is circular (as in the polar chart).

In fact the decompiled code of chart.MouseDown is something like this:

if(!area.IsCircular ...)
{
   area.CursorX.Cursor_MouseDown(this, e);
   area.CursorY.Cursor_MouseDown(this, e);
}

So, the only way is to handle the MouseClick/MouseMove events, get the points values using HitTest method and do whatever you need manually.

For example, this answer explains how to show a tooltip on MouseClick/MouseMove event.


EDIT :

Here's a full working code piece showing how to implement the selection in a polar chart.

Screen-shot:

enter image description here

Community
  • 1
  • 1
digEmAll
  • 56,430
  • 9
  • 115
  • 140