TrackballBehavior.show and panning into view

Hi, I've got a set of points on a google map that correspond to points on a SfCartesianChart. When I click on a point on the google map I want to show a trackball on the chart at the xAxis position that corresponds to that point. I've found that I can do this by using TrackballBehavior.show(), but when the graph is zoomed in and the tapped point on the map is one that is outside of the current visible range on the chart the trackball just goes to the edge of the chart without panning the actual point into view. Is there any way to get the chart to pan the point into view and show the trackball at the correct point?


3 Replies 1 reply marked as answer

SK Sriram Kiran Senthilkumar Syncfusion Team September 21, 2022 04:13 PM UTC

Hi Evan,


Greetings from Syncfusion.

We have checked your query at our end, and we have created a workaround simple sample in which we have used a button to show the trackball using the show method for the point outside the visible range by changing the chart range on click based on the point on which the trackball needs to be shown. We have also attached the sample below for reference.


Please check and get back to us if you require further assistance.


Regards,

 Sriram Kiran


Attachment: f177629_bee31708.zip

Marked as answer

EK Evan Kerik September 22, 2022 12:22 AM UTC

Hi Sriram,


Thanks so much for creating that sample. It works very well!


I made one change so I'll leave  a note about it here in case anybody else is looking for the same thing. Changing the visible min/max triggers an animation if a zoom needs to performed it seems, so the sample uses a 1 second delay before showing the trackball to get around that, but on button press you can also set the animationDuration for the series to 0 -> trigger the trackball show without delay -> reset the animationDuration. This will move the visible range and show the trackball instantly.


Thanks again Sriram Kiran!



SK Sriram Kiran Senthilkumar Syncfusion Team September 22, 2022 08:57 AM UTC

Hi Evan,


Most welcome. Kindly get back to us if you have further queries. We are always happy to assist you.


Note: If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Regards,

Sriram Kiran


Loader.
Up arrow icon