Search code examples
javascriptreactjsreact-hookslightningchart

How to disable only zoom interactions in arction lightning chart


I would like to disable only the zoom interaction on the LightningChartJs but would still like to tap into the drag and other events.

But when I disable it(setMouseInteractionRectangleZoom) other interactions like drag dont run too.

Thanks in advance.


Solution

  • There is no issue with the library and was a flaw in my implementation

    I was dynamically enabling and disabling zoom and other functionalities with state variables and the create chart function was inside useCallback hook and thus the chart had become unfunctional as the useCallback on change of state variables rerenders the function.

    Apollogies to the team of LightningChartJs.