Skip to content

Legendrank attribute in traces #5501

Closed
@nicolaskruchten

Description

@nicolaskruchten

A new attribute in all traces called legendrank which defaults to the index of the trace in the data array. The legend items will then be sorted by legendrank (ties broken by index in the data array) before being laid out.

As an example for:

data = [
{name: "A", legendrank: 2}
{name: "D", legendrank: 4, legendgroup: "G2"}
{name: "E", legendrank: 4, legendgroup: "G2"}
{name: "B", legendrank: 1, legendgroup: "G1"}
{name: "C", legendrank: 3, legendgroup: "G1"}
]

then I would expect the legend order to be: G1(B,C), A, G2(D,E).

Note that the group order matters in the example above, when this will be coupled with #5260 and/or legendgroupgap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions