Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hovermode + spikemode all the time #2026

Open
Princezhm opened this issue Sep 20, 2017 · 8 comments
Open

hovermode + spikemode all the time #2026

Princezhm opened this issue Sep 20, 2017 · 8 comments
Labels
feature something new P3 backlog

Comments

@Princezhm
Copy link

Princezhm commented Sep 20, 2017

Hi,

looking for a solution to a chart that I'm doing I got to this link:
#1959

basically, what I want is to display a label at the end of a spikeline instead of the marker (little circle) but also what I want and what was requested on the link above, was to have a way to always have the spike line and display it so the user doesnt have to go to the closes point in order to see the spike line.

here is an image of what I want to achieve:

screen shot 2017-09-19 at 2 58 10 pm

the lines in the X axis is always there and also it show a label at the end (grey label, not the red one)

@alexcjohnson
Copy link
Collaborator

This sounds to me like three? related feature requests:

  • Allow you to always split the x hover label from the y (which currently we only do when displaying multiple labels - and following that example, I guess anything else that might be displayed in the label stays with y)
  • Allow the y hover label to be positioned on the axis, like the x common label, rather than at the point
  • Allow hovering on arbitrary points on the plot, irrespective of whether there is data there or not. At first I was curious how this should work when you are near a data point - would the hover info snap to the data point or not? But I think we already have what's needed to control that: normally the data point would win, but if you don't want that you can turn off hoverinfo for that trace entirely (hoverinfo: 'none' or hoverinfo: 'skip').

@alexcjohnson alexcjohnson added the feature something new label Sep 20, 2017
@Princezhm
Copy link
Author

@alexcjohnson
actually it should be something like the guy on the previous ticket.

  1. add a prop to show a dynamic X and Y axis along the chart
    68747470733a2f2f63646e2d7374616e646172642e646973636f757273652e6f72672f75706c6f6164732f706c6f742f6f726967696e616c2f32582f642f643338323762386364353235623566396235313131643462393366316533333635333430343363352e676966

as you can see he can move the mouse and it will follow it, so instead of just drawing the spike when the user is over the point/line/whatever, it will always be there and the user can use it as a "RULE"

  1. allow to add a custom label on the X/Y axis so it can show all the time the current position of the X/Y cursor, for example, on the image, you can see that the chart has the range of [129.00, 129.05, 129.10, 129.15] but the user has the cursor in a position where it displays on the grey label the value 129.061.

Allow hovering on arbitrary points on the plot, irrespective of whether there is data there or not. At first I was curious how this should work when you are near a data point - would the hover info snap to the data point or not?
I think it should display the label on the axis and display the info on the point, what do you think?

as reference, this idea comes from this kind of charts:
https://www.tradingview.com/chart/?symbol=FX:EURUSD

as you will see, you can move your mouse and it will display the spikeline all the time and it will follow the cursor and also displaying the values on the Y and X axes.

I hope this features would help, i think they should be really useful when creating financial and other kinds of charts.

@xchen437
Copy link

Any progress on this feature?

@ProgrammingLife
Copy link

Any progress?

@sam-huang1223
Copy link

Also related - but way to synchronize the spikeline across multiple plots in a subplot?

@pgbrandao
Copy link

@sam-huang1223

Given the timing you've probably already figured it out. But for reference, to have a spikeline across multiple plots in a subplot, assuming they are stacked on top of each other, you must use a single x axis. Pass shared_xaxes=True when making the subplots, set the spikes normally on the x axis, then update the traces to the lowest one by calling update_traces(xaxis='x4') (replace 4 with the number of plots).

For example:

fig = plotly.tools.make_subplots(rows=4, cols=1, shared_xaxes=True)
fig.update_xaxes(showspikes=True)
fig.update_traces(xaxis='x4')

I'm still looking for a solution on the issue.

@cmcapone
Copy link

I wanted to check in on this particular issue.
The one that is linked to it, https://github.com/plotly/plotly.js/issues/2155 seems to handle the x and y lines without issue.
What seems to be missing is the data label on the Y-Axis.

Is there any current way to enable that? It seems to work with scatter plots, but Not with Candlestick nor OHLC charts.
Scatterplot working example https://github.com/plotly/plotly.js/issues/2155#issuecomment-731812063
I tried the code listed in that comment with Candlestick and OHLC and no y-axis label appears.

@RylandCapital
Copy link

would love this feature

@gvwilson gvwilson self-assigned this Jun 10, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added the P3 backlog label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 backlog
Projects
None yet
Development

No branches or pull requests

9 participants