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.
Asked
Active
Viewed 1,663 times
1

digEmAll
- 56,430
- 9
- 115
- 140

foreign_quiche
- 13
- 3
1 Answers
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:
-
What about a drawing method? Can I draw a circle or rectangle and get all the points inside the figure? – foreign_quiche Sep 20 '12 at 10:33
-
Where should I start if I want to develop this option? – foreign_quiche Sep 21 '12 at 14:59
-
@user1685358: I have created a full example (and it has been really difficult...). Check my edit :) – digEmAll Sep 21 '12 at 22:28
-
Sorry, the code on paste-bin was set as private. Now it's accessible :) – digEmAll Sep 22 '12 at 08:35
-
thanks :) I just checked the page again since last time... thank you very much – foreign_quiche Oct 01 '12 at 15:34