Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

speficy color based on a certain value in my bar chart

Hi Guys,

I have a bar chart with diffrent delaycodes. This is there a way I can appointed a speficy color based on a certain value in my bar chart?

I tried this in the dimension tab and in my expression. However without any success.

This is my expression:

if(DelayCode='Ontime',

RGB(80,202,28),

If(Match(DelayCode='AIR', 'SEA', 'CONSOL'),

RGB(222,38,38),

count(Order)/count(total Order)))

it seems that the color settings in the color tab are overrulling my expression. Is my expression btw OK?

Hope some one can help or point me to the right direction.

Thanks in advance!

Isam

1 Solution

Accepted Solutions
SunilChauhan
Champion
Champion

see the attached file for your refrence

you can change the color code

in backgroung use this code

if(DelayCode='OnTime',

red(),

if(Match(DelayCode, 'CONSOL', 'CONSOL SEA', 'ELL', 'EMBARGO AIRLINES', 'OnTime', 'OurFault', 'SASO', 'SYNC'),

blue()))

Sunil Chauhan

View solution in original post

7 Replies
kji
Employee
Employee

You need to put the color expression as "Background Color" subexpression, not in the main expression.

Anonymous
Not applicable
Author

Hi Johan,

If you mean in the dimension tab under ‘background color’. I already did that. Didn’t work.

Cheers

iSam

SunilChauhan
Champion
Champion

in expression you can write

count(Order) / Count(Total Order)

and at Background Color expression you can write

if(DelayCode='OnTime',

RGB(80,202,28),

if(Match(DelayCode= 'CONSOL', 'CONSOL SEA', 'ELL', 'EMBARGO AIRLINES', 'OnTime', 'OurFault', 'SASO', 'SYNC'),

RGB(222,38,38)))

hope this helps

Sunil Chauhan
Anonymous
Not applicable
Author

Hi Sunil,

I already tried that and that didn’t work. L L

isam

Anonymous
Not applicable
Author

Hi sunil,

I retried that solution, however with no success. L

Isam

SunilChauhan
Champion
Champion

see the attached file for your refrence

you can change the color code

in backgroung use this code

if(DelayCode='OnTime',

red(),

if(Match(DelayCode, 'CONSOL', 'CONSOL SEA', 'ELL', 'EMBARGO AIRLINES', 'OnTime', 'OurFault', 'SASO', 'SYNC'),

blue()))

Sunil Chauhan
Anonymous
Not applicable
Author

Thanks Sunil,

I added the expression the under the Dimensions tab rather then the Expressions tab. That's why it wasn't working.

Thanks for your help!

iSam