We have a gauge that could be from 0% to 100%.
The user can configure what is "bad", "regular" and "good".
For some product, for example, a 50% performance could be "good", but for other product 90% is "bad" and 95% is "good". The gauge needs to have the color of what is considered for that product.
[
{"0": "#cf7911"}, # bad color
{"75": "#ffff00"}, # regular color
{"90": "#58d68d"} # good color
]
In this case, the bad goes from 0 to 74, regular from 75 to 89 and good from 90 upwards.
It's an array so I always know in what position is the bad, regular and good and the key for that dictionar is the value of the range.
In the gauge I have 2 params, the value and the color. Before the color property needed the value property to execute (inside of the script). So sometimes when the script was trying to execute, it will search for the "value" property and it will fail.
Now the value property is in a custom (indirect path), the color property is in a custom (indirect path), and the bindings for the gauge are expression structure that look for the custom.
Note: As you could see there is a "params". This is because the gauge is inside another view, so we use an embedded view and the params are passed to the gauge inside the view.
Hope I explain myself now ^^