grafana / grafana/scenes

Disabling Legend entries by default is not working

Open
#809 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
206
Forks
59
Avg merge
4d 12h
Merged PRs (30d)
19

Description

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:

```js
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](https://github.com/grafana/scenes/assets/44293756/bc606cf6-e58a-43d4-9bf4-0692fd19f8bb)
Before it looks like this:
![image](https://github.com/grafana/scenes/assets/44293756/2ced6f3c-d5e5-41e6-9c43-8393cfd3e673)

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!

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the provided builder.setOverrides snippet, focusing on overrideCustomFieldConfig("hideFrom") and the legend interaction. Then inspect how Grafana Scenes handles hidden legend entries and the systemRef behavior; done means entries are hidden initially but can be clicked to become visible again.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.