-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Separate tooltips for candlestick hover #2959
Conversation
This commit adds a new attribute to ohlc and candlestick figures called 'hoveron' (as in box hover). Setting 'hoveron' to 'ohlc' shows at most 4 tooltips, for high, open, close and low. If several values should appear at the same coordinate, they are shown together in a single tooltip.
Thanks @codrut3 - very nice!
@etpinard @chriddyp @cldougl what do you think? Do we need to keep the existing behavior (a single hover label containing all four values) and allow this as an option, or should we just switch to this version? The best argument I can think of for the existing version is if users like to be able to read off the four values in a consistent order (top to bottom open, high, low, close) but I'm not really a user of this chart type myself. To your other question:
This controls when to show spike lines, and which ones to show. Click "Toggle spike lines" in the modebar. This is different from (BTW happy Labor day 😅 - we may not hear back from other folks until next week) |
Looks great! I don't really have a preference for the default behavior. |
Hi @alexcjohnson , Thank you for the comments! I left I also left 'points' as an option, because if the figure is small all the boxes are displayed close to one another, and it might be better to have the info in a single block. Like in the following example: Also, I didn't add the I tried with "Toggle spike lines" and it looked fine to me. I wish you a nice weekend! Enjoy Labor day! 😄 |
This gets my vote. Somewhat related to this PR, I've heard users on the forums wanting to show only a few selected sub-labels (e.g. q1,q3,mean) in
This brings in an interesting point. Where should we place |
Hi @etpinard, That's a good idea and better than what I did. Should I add a new boolean attribute hoverlabel.split? I think this will make it available for all traces. |
No, we don't want to make it available to all trace types. It should be available only for The way to do it is:
|
Hi @etpinard, I changed the attribute to |
Brilliant PR @codrut3 Thanks for very much 🎉 |
@codrut3 Can we have this common one tooltip for other charts as-well ?? Created a stackover-flow question for the same with code and screen shots. https://stackoverflow.com/questions/53380131/customize-tooltip-for-multiple-graphs-in-one-plot |
Hi,
I am interested in learning plotly.js and I thought I would make some contributions along the way :) I apologize if I am not following the rules properly.
This PR is for feature request #2706. I followed the suggestions in the comments and I modified the box hover code to work for ohlc and candlestick. Here is a screenshot of how it looks:
I also added a test in hover_label_test. I should say that I don't really understand everything: for example, I defined spikeDistance for the points that the functions returns, even though I am not sure how it's used.