Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'd like to add conditional colors to a gauge chart. To do this, I created a container with three gauges inside:
- One red
- One yellow
- One green
And they display based on the data value. However, I have 10 gauges, so this requires a lot of calculations and my dashboard is slow to display.
Is there a more efficient way to color the gauges based on the data value?
On other charts, such as bar charts, it's much simpler with just a conditional color value.
Thank you!
Yes in appearance
Colour sections use by expression
IF(Sum(Sales) < 50, rgb(255,0,0),
IF(Sum(Sales) < 100, rgb(255,255,0),
rgb(0,255,0)))
Thanks for your reply, I did this for other charts like bar charts, but this option does not exist on the gauge chart.
This option is possible if you activate 'segments' in the presentation area. However, defining colors this way could be very annoying if you need more than 2 colors.
Another option could be to define the color by adding your KPI as master KPI and define the color at this point, e.g. KPI_1_red, KPI_1_yellow, KPI_1_red, KPI_2_red, …
KPI_1 = sum(sales)
KPI_2 = avg(sales)
…
Then you can select your gauge color using endless if-statements …
=if(KPI_1 <= 50
,KPI_1_red
,if(KPI_1 <= 100
,KPI_1_yellow
,KPI_1_green
)
)
… but looks also a bit weird.