The goal
I use Python with plot.ly for plotting candlestick charts and I need a measuring tool for getting distance between 2 elements. Example:
The lib doesn’t have such a tool so I tried to write it. My logic is - handle first mouse click on a chart, then handle all mouse moves and plot new line/box on the chart.
I tried:
- Get position with
clickData
andhoverData
but it returns only clicked element. I can’t get an exact point, when I click on the candle it returns full candle’s data and I need just point. Also, the events will return nothing when I click outside of an element. - Get mouse position with JavaScript. I’ve tried this example, it works but it returns the position of the mouse inside of browser window and it’s impossible to get data from the chart (price and date).
Also, I was reading about plot.ly plugins. Is it possible to create such a tool with plugin?
Thanks in advance .