This is a migrated thread and some comments may be shown as answers.

CartesianMarkedZoneAnnotation drag handles?

2 Answers 101 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 30 Jun 2014, 09:57 AM
Any way of adding drag handles to a CartesianMarkedZoneAnnotation?

Thanks,

Jonathan

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 02 Jul 2014, 12:13 PM
Hi Jonathan,

I already answered your question in the support ticket that you opened. I will post the answer also here so that it will be available for the other members of our community.

The RadChartView doesn't support an annotation with handlers out of the box. However, you should be able to achieve your requirement with custom implementation. For example you can have two CartesianGridLineAnnotations which will represent the handlers. The annotations can be placed at the same start and end dates of the CartesianMarkedZoneAnnotation. Then you can subscribe (for example) for the MouseMove event of the chart view and if the mouse is under the handler's annotation, and based on the mouse position, you can move the annotations. You can use the ConversionAPI to get the data point under the mouse and use its date.

Another approach is instead of the MouseMove to use drag/drop events. I prepared a sample project with the DragDropManager that demonstrates resizable marked zone annotation. Please keep in mind this is a custom implementation that is not well tested and I cannot guarantee that it will work correctly in all possible scenarios. This is why I suggest you to use the approach from the project only as a base for your implementation


Regards,
Martin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Jonathan
Top achievements
Rank 1
answered on 02 Jul 2014, 03:24 PM
Thanks for the response... the first suggestion (additional CartesianGridLineAnnotations) has worked very well, will try the DragDrop solution as well later on. That ConversionAPI is a useful tool!

Jonathan
Tags
ChartView
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or