Vertical or/and horizontal line that is always shown in any hovermode


#1

Hi Everyone,
I am looking for a working examples .
I have seen a lot of stuff reg but could not find the working examples.

Vertical or/and horizontal line that is always shown in any hovermode

Thank You
Venkat


#2

Here’s one: https://codepen.io/etpinard/pen/MLVrYr


#3

Its working if we have single x-axis and single y-axis.
But in my scenario we are having multiple y-axis.

I added on x-axis showspikes: true, spikemode: ‘toaxis+across+marker’, spikesnap: ‘cursor’

Can You pls advise where its wrong.

Thank You
Venkat


#4

Can you share a reproducible code snippet to help us debug? Thanks!


#5

Hi etienne,
my code is similar to the fiddler https://jsfiddle.net/2v2qp0hy/2/
Even the multiple Y axes code I have done using the fiddler given above.

can we add spike to it .
I added “xaxis”: { showspikes: true, spikemode: ‘toaxis’, spikesnap: ‘cursor+data’ }.
But it did not work.

Thank You.
Venkat


#6

You were using an old version of plotly.js that didn’t include spikes.

Looks like https://jsfiddle.net/86upsg2d/ works ok.


#7

Yes the spikes is working on the latest fiddler.
But can we show the data on hover on all the legends . And then add spikes.
the spike will be as reference at the particular point to see all the legends hover.
i.e a line (spike) + to see all the legends data.

or just add the line and show all the legends hover data.

Thank You
Venkat


#8

I’m not sure what you mean by “hover on all the legends”. Could you clarify? Thank you!


#9

Hi Etiennne,
I have hovered on the 2nd Trend from Top.
So the spike its shows on the Trend( red color) all the rest of the trends are hovering the data.

Its a combination of spike +hover on the rest of Trends.


#10

Ha, I see you’re using that Fx.hover trick.

Spikes don’t work so well with Fx.hover at the moment unfortunately:


#11

Thank You etienne.
But it happens only when we have multiple y-axis.

Thank You
Venkat