Pre loader

How to prevent annotation dragStarted event triggered while panning with ZoomPanModifier?


I have a real time updated chart and users can add annotation to the chart. The position of the annotation will be updated with the chart data. I would like to stop updating the annotation position while user dragging the annotation. So I added a flag (e.g. isDragging) to the annotation dragStarted and dragEnded events. The isDragging flag will be set to true in dragStarted and then set to false in dragEnded. I will check this flag before updating the annotation position.

Here’s the problem, the annotation dragStarted event will be triggered when users do panning in the chart. But the dragEnded will not be triggered in this case. It breaks my plan to stop updating the annotation position as the isDragging will be incorrect. Is it a bug that the annotation dragStarted event (but not the dragEnded event) triggered when panning?

  • You must to post comments

Hi Andrew,

I have created a simple example with codepen:

Steps to reproduce:
1. Start the demo with the console opened.
2. Drag the annotation. You will see the logs “drag started – isDragging: true” and “drag ended
– isDragging: false” as expected.
3. Pan the chart. You will see the logs “drag started – isDragging: true”.

  • You must to post comments

Hello, a bugfix for this issue was published in v3.0.317 of the library.
Please, try it out and let us know if it works as expected on your side.

  • Quyen Sy
    Hi Jim, it works well now. Thanks!
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies