Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
MVP
MVP

Re: Maintain Same Colors across different pie charts

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)

4 Replies
MVP
MVP

Re: Maintain Same Colors across different pie charts

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)

Re: Maintain Same Colors across different pie charts

Hi,

   Checkout this.

Regards,

Kaushik Solanki

nagaiank
Valued Contributor III

Re: Maintain Same Colors across different pie charts

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

Hope this helps

Not applicable

Re: Maintain Same Colors across different pie charts

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