I'm using SfCartesianChart.
How can I detect when a user double-taps on a chart? Does the package have an event like "onTap" for this purpose?
Hi Bar,
We are validating your query at our end, and we will update further details in two business days within May 16, 2024. We appreciate your patience until then.
Regards,
Preethika Selvam.
Hi Bar,
Currently, we don't have callback support to detect the double tap in the chart area and we have considered your requirement as a new feature and logged a feature request for it in our feedback portal. We will prioritize the features of every release based on demand and priority. So, this feature will be available in any of our upcoming releases. You can also track the status of the feature with the feedback below.
Feedback: https://www.syncfusion.com/feedback/57360
However, we have prepared the workaround sample to detect the double tap in the chart area with the help of onChartTouchInteractionDown and onChartTouchInteractionUp to detect the tap count and the time difference between the first and second tap and trigger the double tap. Here we have rendered a circle shape in the double-tapped position and shared the sample below for your reference.
Regards,
Yuvaraj.
Thank you for your response.
I would like to implement the following behavior:
Hi Bar,
We have prepared a workaround sample to show the crosshair at the double tap and hide it again performing the double tap. Here we disable the crosshair getting hidden after some time by overriding the interaction in the crosshair behavior, then activate the crosshair at the double tap and hide when performing the double tap again. We have shared the workaround sample below for your reference. If you have any queries please get back to us, we are always happy to assist you.
Regards,
Yuvaraj.
Thank you for your quick response.
The solution is fine, but I would like to make a small adjustment. After the first double-tap, the user should be able to tap once to display another position. Finally, when the user wants to hide the crosshair, they can double-tap again.
@Yuvaraj Gajaraj
Hi Bar,
To activate the crosshair at a double tap and show the crosshair in another position at a single tap, you can achieve this by calling the CrosshairBehavior show public method in the onChartTouchInteractionDown event and passing the position value when the crosshair is in an active state. Then hide the crosshair when performing a double tap again using the hide public method. We have shared the sample with the required changes to meet your requirements. If you have any further queries please get back to us, we are always happy to assist you.
Regards,
Yuvaraj.