Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
Not applicable

Use color by expression to match pie chart and bar graph colors?

Hello,

I want to color by expression in my bar chart so that the colors of the different Notification types match the colors in the pie chart.

I know I can use IF statements to color by expression in my gar graph (i.e. If([Notifictn type]='DR", green (), blue()), but how can I figure out what the exact colors are in the pie chart so that the colors will match?

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Use color by expression to match pie chart and bar graph colors?

The pie chart can also be configured to use an expression to assign colors to the segements. You can use an expression like =Color(FieldIndex('Notifictn type',[Notifictn type])) to always give each dimension value the same color. As long as you use the same expression in all the charts you'll get the same colors.


talk is cheap, supply exceeds demand
4 Replies
MVP & Luminary
MVP & Luminary

Re: Use color by expression to match pie chart and bar graph colors?

The pie chart can also be configured to use an expression to assign colors to the segements. You can use an expression like =Color(FieldIndex('Notifictn type',[Notifictn type])) to always give each dimension value the same color. As long as you use the same expression in all the charts you'll get the same colors.


talk is cheap, supply exceeds demand
Not applicable

Re: Use color by expression to match pie chart and bar graph colors?

Thank you - do I use that expression in the appearance section where I would color by expression or in the data load editor?

Not applicable

Re: Use color by expression to match pie chart and bar graph colors?

When I use that expression I get an error saying that the data set contains negative values

MVP & Luminary
MVP & Luminary

Re: Use color by expression to match pie chart and bar graph colors?

Please post a small Qlik Sense document that demonstrates the problem.


talk is cheap, supply exceeds demand