dash-tradingview icon indicating copy to clipboard operation
dash-tradingview copied to clipboard

How to subscribe lightweight chart events?

Open aliveoceans opened this issue 2 years ago • 4 comments

How to subscribe lightweight chart events?

aliveoceans avatar Feb 17 '23 13:02 aliveoceans

Hi @aliveoceans , this repo got recently updated. The original Tradingview lightweight chart library supports subscribing mouse even (hover on chart coordinates, mouse clicks) - they are now supported in this Dash component in the form of a prop. You can get the mouse events from the crosshair and click properties. Hope it helps.

tysonwu avatar Feb 21 '23 20:02 tysonwu

Hi @aliveoceans , this repo got recently updated. The original Tradingview lightweight chart library supports subscribing mouse even (hover on chart coordinates, mouse clicks) - they are now supported in this Dash component in the form of a prop. You can get the mouse events from the crosshair and click properties. Hope it helps.

Hi @tysonwu , Thanks for your efforts and quick response. I am able to access the click event as expected. Is there a way to implement crosshair synchronization between multiple charts like this https://jsfiddle.net/trior/y1vcxtqw/ ?

aliveoceans avatar Mar 05 '23 16:03 aliveoceans

Hi @aliveoceans, Thanks for trying out the component. I briefly looked at the jsfiddle you provided. The syncronization is driven by chart.setCrossHairXY() which does not exist in the original charting library. I believe it is only achievable by modifying the original charting library in js (see this discussion).

tysonwu avatar Mar 05 '23 16:03 tysonwu

Hi @tysonwu! Thanks for your work.

Syncronization between multiple charts added to original library - https://tradingview.github.io/lightweight-charts/tutorials/how_to/set-crosshair-position#syncing-two-charts. Would you mind add this feature to your implementation?

s71m avatar Mar 21 '24 21:03 s71m