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

Conditional text dimension change in bar chart

Hi guys, is it possible to color the text of the dimension label according to a condition? 

I'd like to color the text of the dimension in red if a particular condition occurs.

I've tried both to set the font text color in the Dimension Axes section (but it changes all the texts at the same time) and set the text color in the dimension property (but nothing happens)

Thanks.

N.

1 Solution

Accepted Solutions
johnca
Specialist
Specialist

In a BAR chart? Man, my comprehension is really lacking today...sorry.

Try this example: https://community.qlik.com/t5/QlikView-App-Development/how-to-color-text-of-a-dimension-of-a-bar-cha...

View solution in original post

5 Replies
johnca
Specialist
Specialist

Expand the Dimension attributes by clicking the + sign, click on Background Color, and enter your expression.

HTH,

John

NickP_DF
Creator II
Creator II
Author

Hello John,

as written, I'd like to change the text color (and not the background color) of the labels, and I've  already tried to set it by expanding the property in the Dimension attributes.

Thanks.

N. 

johnca
Specialist
Specialist

Sorry Nick, I read it wrong. So, you want to change the dimension text color per some conditions? Can you elaborate a little more, or provide an example document? It really can be quite simple, like; If(some_condition = desired_result, rgb(255,0,0)). It needs to be related to the dimension and not ambiguous.

 

NickP_DF
Creator II
Creator II
Author

Hello John,

very simple the example, maybe not so easy the solution; I have a bar chart and and I like the name of the dimension colored thank to a condition.

Keeping the condition apart, if you set dimension text color with this formula: 

=If(1=1, LightRed(), LightBlue())

you'd see the dimension text color not set Red nor Blue, but it remain black.

So, my question is: is it possible to color the dimension texts according by a condition? In which way?

Thanks.

N. 

johnca
Specialist
Specialist

In a BAR chart? Man, my comprehension is really lacking today...sorry.

Try this example: https://community.qlik.com/t5/QlikView-App-Development/how-to-color-text-of-a-dimension-of-a-bar-cha...