grafana / grafana-foundation-sdk

A set of tools, types and libraries for building and manipulating Grafana objects.
Apache License 2.0
28 stars 1 forks source link

Is it possible to configure value color scheme? #44

Closed hallum closed 7 months ago

hallum commented 7 months ago

For a State timeline panel, I would like to set the Color Scheme in Standard Options to "From thresholds (by value)"

I see in the SDK the types and builder for FieldColor exist, but I do not see a way to apply these to a given panel.

Does the SDK support a way to leverage the NewFieldColorBuilder for the statetimeline panel?

thx!

spinillos commented 7 months ago

You can use Defaults function to pass the FieldConfig for that panel. FieldConfig contains the Color field.

Its a bit hidden and its something that we could improve :)

hallum commented 7 months ago

Thank you! Defaults works great.