Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to change single bar color in combo chart.
For Example: Dim = Product
Measure 1: Quantity
Measure 2: Price
Measure 3: Revenue
Note: Measure 1 & 2 are grouped (Drilling in Expression).
However My Requirement is, should display Quantity (Bar) is in Red color and Price (Bar) is in Green color. (When i click drill in chart)
Thank You.
Regards,
NiHhal.
Steve Dark, I think Nihhal L wants to see each bar with differente colors, right?
Maybe you don´t need an IF statement, a fixed lightred() and lightgreen() should work on each bar
If you drill on the expression you can enter code for the bar colour, it will need to be something like:
=if(Only(Product) = 'Quantity', rgb(255, 100, 100),
if(Only(Product) = 'Price', rgb(100, 255, 100),
if(Only(Product) = 'Revenue', rgb(100, 100, 255), null())))
Null will revert back to the colours on the colour tab of the chart.
I tend to always put colours in variables, so that the colour can be changed in one place regardless of where it appears, eg:
=if(Only(Product) = 'Quantity', $(vColQuantity),
if(Only(Product) = 'Price', $(vColPrice),
if(Only(Product) = 'Revenue', $(vColRevenue), null())))
Hope that helps,
Thanks for swift reply,
Please let me know where can i paste exactly this script.
Actually i want to change color only for Quantity Bar.
NiHhal.
Each expresion as an small "+" just beside it.
Click on it and set "Background Color"
Thanks Clever.
Nihal, if you follow Clever's screenshot you can find the Background Colour code. The code will be:
=if(Only(Product) = 'Quantity', rgb(255, 100, 100),
if(Only(Product) = 'Price', null(),
if(Only(Product) = 'Revenue', null(), null())))
Obviously you could simplify to take out the IF statements for Price and Revenue - but this will allow you to drop in other colours at a later date if you wish.
Steve Dark, I think Nihhal L wants to see each bar with differente colors, right?
Maybe you don´t need an IF statement, a fixed lightred() and lightgreen() should work on each bar
Apologies, I missed that they were different expressions rather than dimensions. In that case the simpler approach would be to go to the colours tab and click the multicoloured tick box and set colours 1, 2 and 3 through the UI. Doing it in code perhaps the more robust though.
Thank You Clever Anjos.
NiHhal.