Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Consistent colours on several pie-charts on the same sheet

Hi all,

Hoping this can be done and perhaps someone could advise?

I have 6 pie-charts on the same sheet. Each chart has <=17 categories. I want to ensure that the colours are the same on each chart for a given category. However, note that one chart may have say 10 categories, another may have 16 etc.

Essentially, category x should be red in all charts, category y should be yellow in all charts.

Is there anyway I can do this?

Regards

Revlin

1 Solution

Accepted Solutions
Not applicable
Author

=if(isnull(category),red(),Color(col))

if you want to use your if statement it'll be:

=if(isnull(category),red(),if(category=1,green(),if(category=2,yellow().....................)

View solution in original post

9 Replies
Not applicable
Author

using background color for expression

Not applicable
Author

So would I create an if statement, one for each category then specifying a colour right?

Not applicable
Author

I thought there would be a way via the Colors tab

MayilVahanan

HI

     Try persistent color in color tab..That may also help you i think

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

try this app

(assign colors to each category by inline table)

and use color expression by function Color()

Not applicable
Author

Hi Pari

Sorry but I only have the personal edition of QV at the moment so cannot open other files. Could you copy and paste the code?

Not applicable
Author

code is very simple:)

data:

LOAD * INLINE [

    category, value

    1, 1

    2, 1

    3, 1

    4, 1

    5, 1

    6, 1

    7, 1

    8, 1

    9, 1

    10, 1

];

colors:

LOAD * INLINE [

    category, col

    1, 1

    2, 2

    3, 3

    4, 4

    5, 5

    6, 6

    7, 7

    8, 8

    9, 9

    10, 10

];

what a suggest is to load only one table into your qvw file (colors)

+ read about color() function

and set on each chart expression backgroud : =Color(col)

Not applicable
Author

Ok all good now. I have user if statements for each category within the background colour. The only porblem now is when 'other' is presented. Other is a differnet colour. Any ideas?

Not applicable
Author

=if(isnull(category),red(),Color(col))

if you want to use your if statement it'll be:

=if(isnull(category),red(),if(category=1,green(),if(category=2,yellow().....................)