Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Maintain Same Colors across different pie charts

Hi All,

I have a Dimension called Region and I want to calculate Hires and Turnover according to this dimension.

2 of the Regions have zero values for Turnover. As a result when I make  separate pie charts to calulate Turnover and Hires, the colors on the legend corresponding to each region are different. Please have a look at the attached QVW for details.

Is there some color setting on the chart using which I can maintain the same colors for a particular region on both charts.

For eg.  Australia should appear as Red in both the charts.

Thanks,

Neeraj

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

I didn't expect this to work, but it looks like checkmarking "Persistent Colors" on the Colors tab on both charts does the trick. 

If you want explicit control over the color of each region, you could code it as a background color expression:

if(Region='Australia',red()
,if(Region='Asia',rgb(130,140,150)
...

Or you could define the colors in the script, either with an inline load or maybe a load from a spreadsheet:

RegionColors:

LOAD * INLINE [
Region,R,G,B
Australia,200,100,100
Asia,130,140,150
...

And have a simpler background color expression:

rgb(R,G,B)

View solution in original post

4 Replies
johnw
Champion III
Champion III

I didn't expect this to work, but it looks like checkmarking "Persistent Colors" on the Colors tab on both charts does the trick. 

If you want explicit control over the color of each region, you could code it as a background color expression:

if(Region='Australia',red()
,if(Region='Asia',rgb(130,140,150)
...

Or you could define the colors in the script, either with an inline load or maybe a load from a spreadsheet:

RegionColors:

LOAD * INLINE [
Region,R,G,B
Australia,200,100,100
Asia,130,140,150
...

And have a simpler background color expression:

rgb(R,G,B)

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Checkout this.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
nagaiank
Specialist III
Specialist III

Have you seen this article http://www.qlikfix.com/2010/12/17/consistent-dimension-colors/  ?

Hope this helps

Not applicable
Author

Thanks Kaushik and John for the prompt response. I tried the same solution as suggested by John , but did not check mark 'Persistent Colors'. Thanks a lot.

Regards,

Neeraj