Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Combo chart - Changing colour of bars

Hi Community,

Please can you help...

I have a simple combo chart that compares Actual, Forecast and PY data for 3 channels (Factory, Bought In & Bedding).

I want my Actual Factory, Actual Bought In and Actual Bedding to be one colour.

I then want Forecast Factory, Forecast Bought In & Forecast Bedding to be a different colour.

I then want PY Factory, PY Bought In & PY Bedding to be a different colour.

Please can you help - I have attached my chart to demonstrate my point.

Thanks in advance

4 Replies
mikaelsc
Specialist
Specialist

define your measures as master items, and choose color in the master item definition 🙂

Quy_Nguyen
Specialist
Specialist

Hi Vasim,

You need to color your chart by expression with your Dimension value, here the example:

If(WildMatch(Dimension,'Actual*'), Red(),

If(WildMatch(Dimension,'Forecast*'), Green(),  Blue()))

Best,

Quy

Anonymous
Not applicable
Author

Hi Quy

Thanks so much for replying. Can I ask one more questions if I may...

I type in the following formula:

If(WildMatch(Sales,'Actual*'),Blue(),If(WildMatch(Sales,'Forecast*'),Red(),If(WildMatch(Sales,'PY*'),Green())))

and the graph becomes completely grey in colour i.e. all the bars

If I type in the formula you suggested:

If(WildMatch(Sales,'Actual*'),Blue(),If(WildMatch(Sales,'Forecast*'),Red(),Green()))

the graph becomes completely green in colour i.e. all the bars

Do you know why? The formula expression is correct as QS accepts it, but the colours on the individual bars don't change.

All bars green.png

All bars grey.png

On a separate note, the GP% (horizontal lines above each bar) also change colour when I don't want them to...

Many thanks again.

Vasim

Quy_Nguyen
Specialist
Specialist

What is your dimension in the chart? Please use it it the expression.

The second expression return green color because it's the default color based on If condition logic when dimension not match Actual* or Forecast*

About coloring in combo chart:

+ Color by expression and measure: change color of all measure (bar, line, dot...), it means that for 1 dimension value, all measure will have the same color

+ If you want to have 1 color for bar, 1 color for line, 1 color for dot..., create these measures in master item, pick color for it, then use it in your combo chart, make sure that Color is set to Auto