Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
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

Tags (1)
Labels (4)
1 Solution

Accepted Solutions
Highlighted
Master III
Master III

Re: Specifying a colour for each bar in a chart

Check the attachment and change the colour as per your need

 

View solution in original post

10 Replies
Highlighted
Master III
Master 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()))))

 

 

Highlighted
Contributor
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

Highlighted
Master III
Master 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. 

Highlighted
Contributor
Contributor

Re: Specifying a colour for each bar in a chart

I don't know how to post my app

Highlighted
Specialist III
Specialist III

Re: Specifying a colour for each bar in a chart

you have to close IF 

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

Channa
Highlighted
Master III
Master III

Re: Specifying a colour for each bar in a chart

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

Highlighted
Contributor
Contributor

Re: Specifying a colour for each bar in a chart

 
Highlighted
Contributor
Contributor

Re: Specifying a colour for each bar in a chart

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

Highlighted
Master III
Master III

Re: Specifying a colour for each bar in a chart

Check the attachment and change the colour as per your need

 

View solution in original post