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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text in Chart - setting colours

Hello,

I am trying to set the colour of text in a pie chart based on a condition.

I want the text 'Sales' to appear in green if > 10000, orange if between 8000 - 10000, and red if < 8000.

I tried some versions of the following, but get errors in expression:

=if(sum([SALES VOLUME]) > 10000, 

RGB(0,255,64) 'Sales & Referrals'))

Any help appreciated.

Thanks

Wayne

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

noticed a type in your expression. so instead of this;

=if(sum([SALES VOLUME]) > 10000,

RGB(0,255,64) 'Sales & Referrals'))

try this:

=if(sum([SALES VOLUME]) > 10000, green(), if( sum([SALES VOLUME]) > 8000,rgb(255,128,64), red()))

View solution in original post

6 Replies
JonnyPoole
Former Employee
Former Employee

Which text exactly in the pie chart ? Here i enabled 'values on data points' and added a conditional color for sales < 10000.

Text Color under the expression is:   if(sum(Sales)<10000,lightred(),green())

pie.PNG.png

Not applicable
Author

Thanks for the reply Jonathan,

It is for text added under 'Text in Chart' in the Presentation tab - using the edit expression in the text field.

Not sure if it can be done there?

Wayne

JonnyPoole
Former Employee
Former Employee

that should work too. I put the exact same expression under the font properties (change color to 'caluclated').

Here you can see the text changing color depending on the sum(Sales) in the current selection.pie4.PNG.png

pie2.PNG.pngpie3.PNG.png

JonnyPoole
Former Employee
Former Employee

noticed a type in your expression. so instead of this;

=if(sum([SALES VOLUME]) > 10000,

RGB(0,255,64) 'Sales & Referrals'))

try this:

=if(sum([SALES VOLUME]) > 10000, green(), if( sum([SALES VOLUME]) > 8000,rgb(255,128,64), red()))

israrkhan
Specialist II
Specialist II

Yes , you can do it,,,,

see the steps in image, i just made 1 image of 5 steps, follow the steps in the image...

1.png

Hope it Helps....

Edit:

You already done it....Great

Not applicable
Author

Thank you Jonathan & Isar,

Very helpful, and I can apply the same methodology to the background if I choose.

Thanks heaps.