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

stacked bar chart color

I have two dimensions Products, SubProducts and sales as expression, each product will have either 2 or 3 sub products. i got to display the Same color with gradient for sub products. and these color should be consistent for all products

Ex:

P1 -- > SP1_1 (Blue Dark), SP1_2 (Blue Light)

P2 -- > SP2_1 (Blue Dark), SP2_2 (Blue Light)

Thankyou

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

If you want a more generic you can load a table like this

LOAD * INLINE [

    Products, R, G, B

    A, 128, 128, 180

    B, 128, 128, 200

    C, 128, 128, 220

];

and use RGB(R,G,B) as Background Color Expression

View solution in original post

3 Replies
rustyfishbones
Master II
Master II

you can use an if statement in the background color in the Expression definitions

add something like

IF(P1 = 'SP1_1', RGB(0,255,0),

     IF(P2 = 'SP1_2', RGB(255,200,200),

          IF(P3 = 'SP1_3', RGB(0,100,50),

          RED())))

to here

2013-10-10_1424.png

Clever_Anjos
Employee
Employee

If you want a more generic you can load a table like this

LOAD * INLINE [

    Products, R, G, B

    A, 128, 128, 180

    B, 128, 128, 200

    C, 128, 128, 220

];

and use RGB(R,G,B) as Background Color Expression

Not applicable
Author

Thanks Anjos, i have seen a blog post on this method. was trying to findout if i am missing any standard feature.