Skip to content

Scrollable legends box #1017

Closed
Closed
@CheapGamma

Description

@CheapGamma

Hello! The question is simple, is it possible to make the scrollable box for legends?

I tested several css variants like this:

`

.scrollable-legend {
display: flex !important;
overflow-x: auto;
padding-top: 5px;
border-top: 1px solid #ccc;
}

.scrollable-legend .u-series {
display: inline-block;
margin-right: 15px;
}

`

in hooks:
`

    hooks: {
      ready: [
        (u) => {
            chartStyles(u);
            const legendEl = u.root.querySelector(".u-legend");

            if (legendEl) {
              legendEl.classList.add("scrollable-legend");
            }
        },
      ],
    }

`

`

series: [
    {},
    { label: "Series 1" },
    { label: "Series 2" },
    { label: "Series 3" },
    { label: "Series 4" },
    { label: "Series 5" },
    { label: "Series 6" },
    { label: "Series 7" },
    ...
    { label: "Series 100" },
],

`

Снимок экрана 2024-11-05 190233

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions