Skip to content

Allowing non-unique categorical axis values #1553

@zbjornson

Description

@zbjornson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions