Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello to all the community,
I am trying to color the bars of a bar chart depending on the values that the bars have, like on the example in attachment.
I have a condition on the background color property of the chart. This condition is an if statement:
=if([NumeroIncidenciasMPV]=max(NumeroIncidenciasMaximoMPV,1),Lightred(),Lightgreen())
This is suppose to paint the largest bar with red.
But with this condition all the bars are painted red, but if I use:
=if([NumeroIncidenciasMPV]=4,Lightred(),Lightgreen())
only the first one is red, and this is what I need, but I need the value to be dynamic, so I have to use the expression max(NumeroIncidenciasMaximoMPV,1) or a variable containing its value.
I checked the value of max(NumeroIncidenciasMaximoMPV,1) and it is 4, so I don't understand why this is not working.
Could anyone help?
Thank you!
IF(Rank(SUM{1}NumeroIncidenciasMPV)) = 1, Lightred(), LightGreen())
Tank you!
This works, but only for the first bar. What if I want to make something like on the new attachment?
IF(Rank(SUM{1}NumeroIncidenciasMPV),4) = 1, Lightred(), LightGreen())
Use variables and assign the calculated values in your chart.
For your reference please find attachment.
That statement colors the bars one by one.
Is there a way to color all the bars with the same result with the same color, for example:
All the bars with result=4 with red, all the bars with result=3 yellow and so fort.
Dear Ivo,
Solved problem, please check attached screenshot.
Kind regards,
Ishfaque Ahmed
Hello Ishfaque,
Consider this, what if the value 27 comes from a variable and this variable contains a dynamic value that comes from an expression, for example a max(FIELD) expression.
Because I tried to do this (with the variable) and does not work, all the bars are painted the same color.
Dear Ivo,
Please find attached screenshots.
Kind regards,
Ishfaque Ahmed
Thank you for the reply Ishfaque,
I follow all the step you showed me, the only difference is that you set the value 27 to the variable and I set the expression:
max(NumeroIncidencias)
and with this all the bars are colored red... I have a textfield on the side of the chart to check the value of my $(maximoIncidencaisMPVA) and the value is 4.00000000... Could this influence the if statement?