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

Compare Mode Bar button is for 'x' axis not 'y'axis when all Scatter Chart traces are Horizontal #3619

Closed
PaulRCooper opened this issue Mar 8, 2019 · 1 comment · Fixed by #3646
Assignees
Labels
bug something broken

Comments

@PaulRCooper
Copy link

The compare mode bar button behaviour is for 'x' axis rather than even when you set all the traces to horizontal (orientation of 'h').

If you set the traces as horizontal the Mode Bar and set the hovermode to 'y' the button is unselected (so is the closest button) even though the expected 'y' hovermode behaviour occurs when hovering.

See example at https://jsbin.com/wibivof. Here I have 3 charts:

  1. The first is a horizontal bar chart showing the correct and expected behaviour in both the chart and the button.

  2. The second chart shows a horizontal scatter chart (all traces are horizontal) with hovermode set to 'y' and you get the correct behaviour on hovering but the button is unselected. If you click on the compare button you get 'x' axis compare behaviour instead. To get 'y' mode behaviour requires a refresh of the page.

  3. The third chart is a copy of the second chart but includes a workaround to force the correct behaviour using the plotly_afterplot event to update the hovermode and the button state.

Possibly relates to issue #778

@PaulRCooper PaulRCooper changed the title Compare Mode Bar button is for 'x' axis not 'y'axis when all Scatter Chart traces are all Horizontal Compare Mode Bar button is for 'x' axis not 'y'axis when all Scatter Chart traces are Horizontal Mar 8, 2019
@etpinard
Copy link
Contributor

etpinard commented Mar 8, 2019

The second chart shows a horizontal scatter chart (all traces are horizontal) with hovermode set to 'y' and you get the correct behaviour on hovering but the button is unselected. If you click on the compare button you get 'x' axis compare behaviour instead. To get 'y' mode behaviour requires a refresh of the page.

Behavior w/o setting hovermode to 'y' is in: https://codepen.io/etpinard/pen/eXWXyy

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants