Different colors between plot and legend on Time Series panel

I am using Grafana version 8.5.10 on Windows 10 (but the same on Grafana 9.3.6), Sql Server as data source.
I have a difference between legend (and tootltip) colors and plot colors on Time Series Panel. The colors are different and the right ones are the colors of the plot:

If I re-render the plot (reload page, reload dashboard, close and reopen the corresponding row) all the colors adjust in the right way:

Then if I change the plot in some way (changing time span, changing some dashboard variable values that are included in the queries ect.) the plot changes again its colors in a wrong way.

I have a set of different queries and no Transforms.
The colors scheme selected is “Classic palette”.
I think the problem is in the assignment of the colors on classic palette when there are multiple queries and some can be empty.
If I manually disable the queries that are empty then the time series always behaves correctly.

It seems that the colors on legend and tooltip are assigned wrongly assuming that the empty queries have some values, but the colors of the plot are correctly assigned based only on the query that actually have values.

Thanks

Hi,

This is a bug I also experienced without having empty queries. I believe there is an open pull request on Github about this but until they fix it in a future update you must use a workaround.

  1. Scroll to the bottom of the settings panel on the right and press ‘add field override’ and ‘field with name’.
  2. Press ‘add override property’ and choose ‘standard options > color scheme’
  3. Choose ‘single color’ and pick a colour. There are the Grafana standard suggestions but you can also do custom.
  4. do this for all of your fields. Then the legends and axis will be fixed to the same colour no matter what you change.

I hope this helps

1 Like