Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Is is possilble to get mouse/click position?

$
0
0

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:
Peek 2020-07-09 17-07
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:

  1. Get position with clickData and hoverData 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.
  2. 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 :smiley:.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images