Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to color bars of a bar chart in different colours depending on the value showned

Hi All,

I'm asking for the Community help to solve this apparantly simple problem:

I have a bar chart and every bar should be dyed in a specific color depending on its value.

The expression I'm using in the "Base Colour" calculation is:

if(avg([Assessment Value])<=2, Yellow(), if(avg([Assessment Value])>2 and avg([Assessment Value])<=3, LightGreen(), Green()))

The expression showned by the chart is: vg([Assessment Value])

Now if I filter to see a single column it has the right colour depending on its value, if I see more columns they all have the colour of the first bar.

Thanks a lot for helping

Matteo

1 Solution

Accepted Solutions
Not applicable
Author

I solved, I needed to use the background property of the oexpression instead of the general color property.

Thanks for helping anyway! I learned a new thing!

View solution in original post

2 Replies
Not applicable
Author

try using something like this;

if(rangemin(.5,rangemax(condition),-.5)) < 0,

-Sqrt(-(rangemin(.5,rangemax(condition),-.5)))/(-.5)),

Sqrt((rangemin(.5,rangemax(condition),-.5)))/(.5))),

ARGB(255, 255, 0, 0), ARGB(255, 0, 255, 0), ARGB(255, 255, 255, 255))

Not applicable
Author

I solved, I needed to use the background property of the oexpression instead of the general color property.

Thanks for helping anyway! I learned a new thing!