Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
prabhu0505
Specialist
Specialist

Bar Color

Can I change the bar colors conditionally?

Actually in my bar chart, I wish to highlight the bars based on the values of Expression.

Thanks & Regards,

Saravana Prabhu

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can use the background color attribute for this:

Go to expression tab, open the expression attributes of your bar expression by clicking on the little plus sign next to the expression. Then select the 'Background Color' attribute and enter your condition in the definition field to the right, maybe something like:

=if(sum(Values) > 100, lightred() )

your background color attribute expression must return a color code, either use one of the predefined colors or use rgb() or argb() function to specify RGB colors.

Hope this helps,

Stefan

View solution in original post

2 Replies
swuehl
MVP
MVP

You can use the background color attribute for this:

Go to expression tab, open the expression attributes of your bar expression by clicking on the little plus sign next to the expression. Then select the 'Background Color' attribute and enter your condition in the definition field to the right, maybe something like:

=if(sum(Values) > 100, lightred() )

your background color attribute expression must return a color code, either use one of the predefined colors or use rgb() or argb() function to specify RGB colors.

Hope this helps,

Stefan

Not applicable

I would like to add a similar question: is it possible to change to bar color for an active bar chart and a non-active. What I mean is, I have changed the background and fon color of my objects via variables and expressions. Is it also possible to differentiate between an active bar chart and a non-active?