Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Gradient Colors in Stacked Bar chart change on reload

I have a stacked bar chart showing survey question responses on a rating scale (from agree to disagree) and i'm trying to color each secondary dimension (survey response) so that the colors fade from one response into the next.  I had this set up and looking great, then i reloaded the document and QlikView shifted all the colors around.  Why doesn't it use the colors in order on the Colors tab of the Properties box??  I thought about defining the colors explicitly in the expressions, but i don't know how to make them gradient that way.  Can anyone help me either:

a) keep colors from shifting when i reload?

or

b) explicitly define gradient colors in the expression?

5 Replies
Not applicable
Author

a) Check Persistent Colors flag

b) Use the Colormix Wizard in file menu of Background Color of the expression

Anonymous
Not applicable
Author

not sure why the colors would shift...but when you say shift, is it a specific order?

but for option b, you can use the following expression:

argb(255,255,255,255) bitand color(1)

color(1) gives you the first color in the colors tab. similarly color(2) will give you the second color and so on. you can also use a specific color such as red(), etc. or even use rgb(). the first number in argb function represents transparency...so you can gradually make it transparent to create a gradient effect...so something like:

argb(150,255,255,255) bitand color(1)

argb(50,255,255,255) bitand color(1)

and so on....

of course, you can determine the steps based on number of gradient steps you need.

Not applicable
Author

Thanks jsaradhi and Mario De Stefano, both of your suggestions get me a LOT closer than i've been before.  But they only let me control the first color in the gradient, the second (the color it fades into) is still whichever one from the colors tab QlikView decides to throw in.  Can you tell me how to define the 2nd shade as well?

Maybe i need to clarify what i'm trying to do... on the rating scale, when i show the survey responses that were '5', i want that to show in green, then the responses that were '4' the green fades into teal, then 3 fades into a darker blue and so on until the responses of 1 show as purple.

Anonymous
Not applicable
Author

use the appropriate n value in the function color(n) where n represents the nth color in your color palette...so if you need second color then use color(2) and so on. hope this helps.

may be if you post a sample qvw or a screenshot of what your expected output needs to be...we can address your specific requirement.

Not applicable
Author

I resolved this by setting the gradient colors i wanted in Colors 1-5 on the Colors tab, and selecting Persistent colors.