Modfy the JSON Model with Variables

Main question: what is proper syntax when modifying the JSON model for my dashboard to hard code in a variable?

My goal is to tie my graph colors to a custom variable that I have filled with Hex codes.

I have several panels, and on each I created a series override and set the color to an arbitrary hex value. When I examine my JSON model I can see those hex values. I was hoping to set the color equal to my ‘Main_Color’ variable, but the dashboard didn’t recognize it, or isn’t set up to accept a variable for the color.

So, I thought I’d find/replace things in my JSON Model. I’m currently using variables for queries from an InfluxDB database, and as a selector between some options. In the JSON they appear like this:

So, I found my hex values in the JSON model that are there because of my series overrides, and tried to replace them with syntax for my ‘Main_Color’ variable. I’ve tried several variations (see below) but my graph color stays dark, and doesn’t seem to recognize the variable. I wondered if the ‘#’ sign was giving issues and tried leaving it out of the variable and hard coding it into the JSON model, but that didn’t change anything.

Is there a syntax that I’m missing? Is there a better way? Thanks

attempted sytaxes:

My variable:

Did you figure this out? I’m stuck at basically the same problem. :slight_smile: