Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
agbcn
Contributor III
Contributor III

Coloring stacked bar chart

Hi,

I need to visualize a stacked bar chart and I'm having some problems when coloring. My bar chart looks like this:

Stacked chart.png

As you can see, color for "Currently Critical" and "Necessary" are very similar if not the same. I'd say the problem is the color scheme Qlik Sense is using:

Color scheme.png

Is there any way to change this?

I tried by using Expression, but it doesn't seem to work with stacked bar charts.

Thanks for your help.

Regards

Alex

2 Replies
Kushal_Chawda

@agbcn  Not sure if it will work but you an try below 

In chart properties, Under Colors and legend, switch off Auto colors to activate Custom colors. From the dropdown select By expression. and put below expression

color(fieldindex('Field',Field))

where Field is the bar chart dimension field name

Kushal_Chawda

@agbcn  another option is to assign the color in load script for each field value like below

LOAD *

....

pick(match(Field, 'Value1', 'Value1', Value3',), RGB(236,129,0),RGB(250,185,0), RGB(70,137,164)) as Field_Color

FROM table

Where Field is the Fieldname used in chart dimension and Value1,Value2... are the field values.

Now in chart properties, Under Colors and legend, switch off Auto colors to activate Custom colors. From the dropdown select By expression. and put below expression

=Field_Color

You can try using the same same pick match condition created via load script in place of above expression