Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

pie chart dynamic colors for legend

Hello,

On attached sample document, how can i create a pie chart with persistent colors? I have tried chart properties-->Color-->changed manual colors but if we have more than 10 legends of text then?

Hope someone can manage to help.

Thanks,

Dinesh

9 Replies
Not applicable
Author

Make sure in both charts persistents colors is selected, and in the withe an black chart press button Recover predefine colors. and that should work ut.

I hope it helps!!

its_anandrjs

Hi,

I thing you need to set color for the different legends it is best idea also by this your define color not change. You need to go Properties->Color-> click on first color and its properties and click on calculated option there in window type color for legend like =Red() like ways click second below to first color and do same for that.

Regards,

Anand

Not applicable
Author

Can you please attached an example here to understand more? And also on my attachment, i would like to have a result like second pie chart.

Regards,

Dinesh

Not applicable
Author

Try something like this expression in the background color of the expression.

if

(Series ='AIF 2011', rgb(100,100,100),
if(Series = 'Bond Vigilantes', rgb(50,50,50),
green()))

This will ensure that your series are always displayed as the same colors in the chart. It would be possible to do using the view_id as well, just a much more complex if statement to maintain...

Not applicable
Author

Hi Leonard,

The above script will work if we have only few dimension values. But i have got more than 20 vaules to show on pie chart. Any other possibility to work around?

Thanks,

Dinesh

Not applicable
Author

Make sure in both charts persistents colors is selected, and in the withe an black chart press button Recover predefine colors. and that should work ut.

Not applicable
Author

Dinesh,

Try the attached file out, I think this will do what you want (Or at least is closer!).

Leonard

Not applicable
Author

It does look fine on table chart. But how to implement with pie chat?

Any other suggestion or ideas?

Regards,

Dinesh

Not applicable
Author

You would implement it the same for a pie chart as you would for any other chart type. All you need do is setup a table with a color key for each of the view_id's. I updated your original file a bit so you can see better.