Listener for double-tap events

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?




6 Replies

PS Preethika Selvam Syncfusion Team May 14, 2024 02:56 PM UTC

 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.



YG Yuvaraj Gajaraj Syncfusion Team May 15, 2024 11:19 AM UTC

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.


Attachment: 188222_6a629995.zip


BI Bar Ilan May 15, 2024 12:52 PM UTC

Thank you for your response. 

I would like to implement the following behavior: 

  • When the user double-taps the screen, a crosshair will appear. 
  • The crosshair will remain visible when the user taps on different locations within the chart. 
  • The crosshair can only be hidden by double-tapping again.


YG Yuvaraj Gajaraj Syncfusion Team May 16, 2024 12:33 PM UTC

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.


Attachment: 188222_a525f0b2.zip


BI Bar Ilan May 16, 2024 02:01 PM UTC

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



YG Yuvaraj Gajaraj Syncfusion Team May 17, 2024 03:19 PM UTC

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.


Attachment: f188222_221af090.zip

Loader.
Up arrow icon