Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

cancel
Showing results for 
Search instead for 
Did you mean: 
manojkumargowda
Creator
Creator

Custom colours in stacked bar chart in Qliksense

Hi All,

I have strange a requirement to colour stacked bar chart. I have to colour dimension values (col A in red, col B in blue and col C in Green) and rest of the dimension values (col D to H ) should be coloured with default colours. Is this possible?

8 Replies
kkkumar82
Specialist III
Specialist III

I think not possible

simran04
Contributor II
Contributor II

Hi Manoj,

I am afraid that's not possible.

DavidŠtorek
Creator III
Creator III

Hi,

what you want to do is possible. It is just a little bit complicated. You wil have to set colors for all columns (it is not possible to set only three and let the rest "default")

Do you use only one measure (like sum(sales)) and it is split by dimension (col A)?

If so, than go to Apperance->colors and Legend, set colors to custom and select by expression.

Than set it like this

If(<your dimension>='col A',RGB(170,255,106),

If(<your dimension>='col B',RGB(85,232,216),

    If(<your dimension>='col C',RGB(232,192,85),

        If(<your dimension>='col D',RGB(124,116,255),

            If(<your dimension>='col E',RGB(255,123,99),

                If(<your dimension>='col F',RGB(153,129,96),

                    If(<your dimension>='col G',RGB(204,127,27),

                        If(<your dimension>='col H',RGB(27,204,72)))))))))

Of course use your own RGB value (or if you like it you can use this ) You should get something like this

Capture.PNG

You can refer https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/Colors/color-by-expression.htm

balabhaskarqlik

In Stacked Bar chart - Add Dimensions, measures.

Appearance - Colors & Legend - By dimension.

For Expression wise color apply:

Use below expression, tweak your main expression.

pick(match(Dimension,'K1','E1','B1','B2','B3','Bx'),lightred(),lightblue(),LightGreen(),LightGray(),LightMagenta(),yellow())

balabhaskarqlik

manojkumargowda
Creator
Creator
Author

Thanks guys for your suggestions. I got to know this is not possible.

fdemolin
Contributor II
Contributor II

I think it's a new feature, but I am using the feb 19' version and now we have a solution for that.

1-) Create a master dimension with the exact field name you want to select the color, put a name on it, clik "Add dimension" and "Done".

Capture1.PNG

 

 

 

 

 

 

 

 

 

 

 

 

2-) Right click in the dimesion created, and then go to Value color and select a color for each factor on the list.

 

Capture2.PNG

3-) Now when you create a stacked bar chart, the colors will follow your instructions for this field.

 

Hope it helps.

Abhishek_Pednekar
Contributor II
Contributor II

this is really helpful.

After adding custom colors by expression,  graph lost its Index. anyway to show it as per newly applied colors.