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

How can you add color to List Box items with expression ?

Hello,

I have a List Box, that draws fields/data from a SQL database. I would like each lines background color to reflect a certain condition.

Example :

if (field > 200 and field <= 100,rgb(255,47,47),

if (field > 100 and field <= 50,rgb(144,23,56),

if (field > 50 and field < 0,rgb(23,147,101),

rgb(5,5,5))))

How can I make this work and where must I place this ? I placed this in expressions and in presentation(color -> calculated) but the colors don't show up. If I add it in the expression, then I do get a colom that prints out the correct rgb(?,?,?).


1 Solution
7 Replies
Not applicable
Author

I dont think it is possible by line by line color in the list box,but you can add background color to the list box,find the attached application

anbu1984
Master III
Master III

Not applicable
Author

anbu cheliyan that is for the text color. I want to change the individual background of each line to show either red, green, amber, yellow. The text background color itself, not the text font color.

It's suppose to be a dashboard with these data displayed and the severity should be indicated by each items background color.

Not applicable
Author

Bhawna Gupta  Would you say I could achieve this by using a Table Box , instead of a List Box ?

Not applicable
Author

Thanks Anbu, that's the idea !

However, when I click on an item, THEN it shows the colors in background, but not when all items are shown in the List Box ... only a matter of seconds now ! Thanks for the help

Not applicable
Author

Ok I managed to do the following : Created a Straight Table Chart, added the code into background expression under the designated main expression. thanks for all the help !