grafana / scenes

Build Grafana dashboards directly in your Grafana app plugins.
https://grafana.com/developers/scenes
Apache License 2.0
141 stars 21 forks source link

Disabling Legend entries by default is not working #809

Open ptrkkr opened 4 months ago

ptrkkr commented 4 months ago

Hi all!

I think this is the same as #792. We are not able to disable legend entries by default. We want only to disable if the user opens the page but whenever he clicks on it, it should work for them.

I am doing the following:

builder.setOverrides((timerSeriesTable) => {
        timerSeriesTable
            .match(
                {
                    id: "byNames",
                    options: {
                        mode: "exclude",
                        names: [
                            "someLegendLabel
                        ],
                        prefix: "All except:",
                        readOnly: true
                    }
                })
            .overrideColor({
                fixedColor: "blue",
                mode: FieldColorModeId.Fixed,
            })
            .overrideCustomFieldConfig("hideFrom", {
                viz: true,
                legend: false,
                tooltip: false
            })

    })

This code disables the other legend entries by default but you can't click on it again to enable it if you want to see it. When you click on it, it looks something like this: image Before it looks like this: image

I can see that in the Grafana dashboards, something like a __systemRef is used which i don't know how i can set in scenes.

I would appreciate some help!