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

colour 3 bars in a chart the same colour

Hi,

I want to color 3 bars in a Bar Chart red but a fourth one blue.

=If([BulbGroup]= '[daffodil]',RGB(255,0,0),

If([BulbGroup]= 'hyacinth', RGB(255,0,0),

if([BulbGroup]= 'Freesia',RGB(255,0,0), RGB(0,0,255))))

I have tried different versions of this code but none have worked.

Any ideas what I can do instead?

1 Solution

Accepted Solutions
MK9885
Master II
Master II

Can you upload a sample qvw?

View solution in original post

6 Replies
sunny_talwar

May be like this:

=If(Match([BulbGroup], 'daffodil', 'hyacinth', 'Freesia'), RGB(255,0,0), RGB(0,0,255)

MK9885
Master II
Master II

Can you upload a sample qvw?

Anonymous
Not applicable
Author

I have tried this & it does not work; I can't upload the qvw

Anonymous
Not applicable
Author

It does not work, sorry!

MK9885
Master II
Master II

We can achieve it another way.

Can you at least share screenshot of that bar chart?

How many bars are there and what color you need?

MK9885
Master II
Master II

Bar Color.png

What you can do here is

Check the colors of your bar, in your case

3 bars

1. Daffodil

2. Hyacinth

3. Freesia

So for Freesia if the color is Off Green (example) so click on 3rd color and give an color expression as if([BulbGroup]= 'Freesia',RGB(255,0,0), RGB(0,0,255))

And you can keep Daffodil and Hyacinth as Red by selecting the color number

Note: After you make these changes do not forget to check the 'Persistent Color' box on the right side.

If you using only single dimension then first check the 'Multicolored box' and hit apply. After then you'll see bar colors here and you can change it with regards to what number your bar is placed.