Home › forums › Using CanvasJS › How to stopPropagation when click data point? › Reply To: How to stopPropagation when click data point?
Let me explain what I met.
I want to have the ability to click any position of the chart to trigger a seek event of my video. So I use the solution provided here https://canvasjs.com/forums/topic/click-event-for-any-cursor-position/.
But I found that due to the density of the data, above link would cause an issue, that is, visually user clicked on the data point, but seek to some neighbor frame. So now I use the default click call back provided by canvasjs , and combine with above link. The issue is, when default callback function is triggered, the solution function in above link also triggered. Thus the seek would be overwrite, and the seek still failed.
Right now, I already found a temporary solution. That is, use a last click time variable to detect the last time the event triggered, to stop the propagation of the action. But I hope canvasjs could provide the native support to this, because I still has issue to below case:
1. when zoomed, the pan button or reset button still propagate the event to up layer, I didn’t found the callback to pan or reset button call back to do my time trick.
2. when use range selection to zoom chart, it also triggered a click event.
So my suggestion is, to all click event in the canvasjs, defaultly stop propagation, or provide option to achieve this.
Did I make my idea clear?