Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
starter888
New Contributor

Specifying a colour for each bar in a chart

Hi everyone

I am trying to colour each of the bars a specific RGB colour.

Can someone help with an expression I can use to specify the colours? Each bar is a result of a % of count e.g. # of dogs, # of cats, # of rabbits

Each animal/category needs to be a specific colour which I have the RGB for.

 

Thanks in advance 🙂

Screen Shot 2019-02-12 at 6.04.21 pm.png

1 Solution

Accepted Solutions
arulsettu
Honored Contributor III

Re: Specifying a colour for each bar in a chart

Check the attachment and change the colour as per your need

 

10 Replies
arulsettu
Honored Contributor III

Re: Specifying a colour for each bar in a chart

Hi 

Under Appearance -> colour and legend 

 

Choose Dimension

and write a calculated expression like

if(dimension='Cat',red(),

if(dimension='Dog',blue(),

if(dimension='rabbits',green(),

if(dimension='Bull',Brown()))))

 

 

starter888
New Contributor

Re: Specifying a colour for each bar in a chart

Thanks for replying.

It's saying:

Screen Shot 2019-02-12 at 6.53.08 pm.png

arulsettu
Honored Contributor III

Re: Specifying a colour for each bar in a chart

it just a sample code

you need to change the dimension 

can you post your app. 

starter888
New Contributor

Re: Specifying a colour for each bar in a chart

I don't know how to post my app

Channa
Valued Contributor III

Re: Specifying a colour for each bar in a chart

you have to close IF 

If(dim='Cat',red())

Channa
arulsettu
Honored Contributor III

Re: Specifying a colour for each bar in a chart

Click reply and left corner there is option to choose your qvf file.

starter888
New Contributor

Re: Specifying a colour for each bar in a chart

 
starter888
New Contributor

Re: Specifying a colour for each bar in a chart

Had to zip as wasn't accepting qvf - hope it works

arulsettu
Honored Contributor III

Re: Specifying a colour for each bar in a chart

Check the attachment and change the colour as per your need