Skip to content

Allowing non-unique categorical axis values #1553

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

Closed
zbjornson opened this issue Apr 5, 2017 · 1 comment
Closed

Allowing non-unique categorical axis values #1553

zbjornson opened this issue Apr 5, 2017 · 1 comment

Comments

@zbjornson
Copy link

zbjornson commented Apr 5, 2017

The Categorical Axes example shows putting text in the x property and setting layout.xaxis.type = "category". However, that approach doesn't work if the x array has duplicate values, in which case Plotly removes them. For example, here's the same codepen with the value "12F" duplicated: http://codepen.io/anon/pen/peBENa (only five bars are present).

The behavior is slightly worse for heatmaps because the number of rows/cols remains the same, but the tick labels are positioned at the wrong row/col:
http://codepen.io/anon/pen/JWVRWq
"Thursday" now labels what should also be "Tuesday", and "Friday" what should be "Thursday"

Someone posted a work-around on Stackoverflow where the ticks are set explicitly:
http://stackoverflow.com/questions/41298571/how-to-allow-duplicate-tick-labels-in-plotly
This is a little bit cumbersome as you have to put a d3.range array (or similar) in the tickvals.

@zbjornson
Copy link
Author

Oops, I missed #1516 from 11 days ago, sorry.

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

No branches or pull requests

1 participant