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

Bar Chart - Color by expression

Hi all,

I know that similar questions have been asked before and I have tried to follow the suggestions, but I still struggle to define colours to the different bars in my chart.

I would like to define the different colours to the different measurements in my bar chart (oil and ags) using colour by expression. Oil should be green and gas should be red.

Hopefully some uf you can help me

Cheers

Helge

snip_20160912105944.png

snip_20160912111630.png

1 Reply
ift_isabelle
Partner - Creator III
Partner - Creator III

Do you have a dimension (or can you create a dimension) where you can tell if it is gas or oil?

maybe it also works on a measruement, but i'm not sure, never tried.

Here is my example:

I have a dimension "Doelgroep", on which i coloured my measures, like this:

Doelgroep.PNG

I used this code for coloring the measures:

if(Doelgroep = 'Primair',vRed,

if(Doelgroep = 'Secundair',vBlue))

I put the code here

where.PNG

(Op uitdrukking = On expresion || Uiterlijk = Appearance)

Don;t forget the box "expression is a colorcode" (or whatever it may be in English).

I declared to variables with the Hex codes, you don't have to do this, It is just a normal Hex code:

variable.PNG

Does this help?