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

Trackball position hold on mouse click

2 Answers 124 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Chetan
Top achievements
Rank 1
Chetan asked on 18 Mar 2013, 12:22 PM
Dear All,
I am trying to achieve following.
Step1  Trackball is moving on the chart, and if user double click on chart i should get trackball point.
Step2  using this trackball point position show CartesianCustomAnnotation and point info in it.
Step3  User can drag and drop  CartesianCustomAnnotation to other place on chart, and now this show that point details.
Step4  User can again double click on other place on chart new CartesianCustomAnnotation open which shows that point details.

Please let me know is any step implementation is possible.
I am using 2013 Q1 release.

Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 21 Mar 2013, 01:52 PM
Hi Chetan,

1. You can register for MouseLeftButtonDown of the chart and if the e.ClickCount == 2 show trackball  point by switching ChartTrackBallBehavior.ShowIntersectionPoints from false to true.

2. By using the TrackInfoUpdated event of the ChartTrackBallBehavior, you can get the X and Y of the closest data point. Using this information, you can create a new CartesianCustomAnnotation, set its Vertical/Horizontal Value and add it to the chart annotations collection.

3. After you add an CartesianCustomAnnotation you can register for its MouseLeftButtonDown and Up. In the Down handler register for the MouseMove event and in the Up event - unregister the MouseMove event. In the MouseMove handler you get the mouse position relative to the chart and using the Conversion API calculate the new position of the CartesianCustomAnnotation.

4. [Same as 2.]

I hope this helps.
 
Kind regards,
Petar Kirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Chetan
Top achievements
Rank 1
answered on 01 Apr 2013, 10:04 AM
Thanks for quick help.
I am still working on same,
Will get back to you if need help.
Tags
ChartView
Asked by
Chetan
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Chetan
Top achievements
Rank 1
Share this question
or