silverspoon
silverspoon

Reputation: 1095

How to custom draw a cursor handle on MS Chart

Can anyone tell me if it is possible to custom draw a cursor handle (can't think of a better word for this) as shown in the image below? I have marked it in red circle.

enter image description here

The aqua coloured inverted triangle can be dragged left or right between two ends of the chart to move the cursor. I am not sure if the control used in the image above is MSChart but wondering if we can do it in MS chart. The difficulty I am having is finding out exact location of cursor because it is relative to the chart area only and the handle I want to draw is outside the chart area. How do I convert chart area location to outside coordinates?

Thanks for your help.

Upvotes: 0

Views: 431

Answers (1)

TaW
TaW

Reputation: 54453

Yes is is possible to create such a Chart but not by drawing on it yourself, please..!

Both the line and the triangle are Annotations, namely a LineAnnotation and a PolygonAnnotation.

A LineAnnotation supports being dragged around out of the box if you set AllowMoving = true. So they don't relly need a handle.. The PolygonAnnotation is best synch'ed with the LineAnnotation. Both usually are positioned in the coordinates of the XAxis, which looks like DateTime in your example, or by setting the data point they sit on..

If you need more help with your code, show how you create the Chart and I can try to help, Charts are powerful but a little tricky..

Upvotes: 1

Related Questions