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

Conditional Coloring in a Bar Chart

Hi,
How can I make the bars pointing to the left (negative value) to be colored as RED rather than all bars are blue in this bar chart?

Capture3.JPG

1 Solution

Accepted Solutions
aveeeeeee7en
Specialist III
Specialist III

Hi Ronnie

Go to your expression and write the Condition eg. Sum(Value)

Expand the Expression and on Background Color write the condition  if(Sum(Value)>=0,Blue(),Red())

It will work for you.

See the Snapshots and Attachment.

Expression.png


Bar Coloring.png

Regards

Aviral Nag

View solution in original post

5 Replies
Gysbert_Wassenaar

Click on the + in front of the expression, select Background Color and enter an expression in the Definition field to calculate the color: =if(sum(Amount)<0, red())


talk is cheap, supply exceeds demand
aveeeeeee7en
Specialist III
Specialist III

Hi Ronnie

Go to your expression and write the Condition eg. Sum(Value)

Expand the Expression and on Background Color write the condition  if(Sum(Value)>=0,Blue(),Red())

It will work for you.

See the Snapshots and Attachment.

Expression.png


Bar Coloring.png

Regards

Aviral Nag

Not applicable
Author

Thank you both, I got the color now. Works like charm.

Now, if only I could get those long numbers shorten into millions, that would be perfect. Any idea?

Gysbert_Wassenaar

num(sum(Amount)/1000000, '#,##0 M')


talk is cheap, supply exceeds demand
Not applicable
Author

It works! Thank you Gysbert.