Trackball position hold on mouse click

3 posts, 0 answers
  1. Chetan
    Chetan avatar
    26 posts
    Member since:
    Oct 2012

    Posted 18 Mar 2013 Link to this post

    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. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 21 Mar 2013 Link to this post

    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.

  3. DevCraft banner
  4. Chetan
    Chetan avatar
    26 posts
    Member since:
    Oct 2012

    Posted 01 Apr 2013 Link to this post

    Thanks for quick help.
    I am still working on same,
    Will get back to you if need help.
Back to Top