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

Applying custom colors for bar graph in qliksense

Hi,

I am trying to apply custom colors for bars in bar graph.

my expression for each bar in graph is below

1.)sum(vegetables)/sum(groceries)

2.)sum(fruits)/sum(groceries)

3.)sum(bananas)/sum(groceries)

How could i apply different custom colors to these bars.Please help me on this.

12 Replies
Chanty4u
MVP
MVP

try

=if(sum(vegetables)/sum(groceries),Red(),Green())

berryandcherry6
Creator II
Creator II
Author

Hi

thanks for reply,

Where should i apply this,

in data or Appearenc?

Not applicable

Hi,

apply it in the background color.

arulsettu
Master III
Master III

can you share the app?

berryandcherry6
Creator II
Creator II
Author

Hi,

i have attached snippet of my work

Capture.PNG

here i have expression for different bars, how could i apply color for this each bars.

Not applicable

Hi,

You can go to the chart properties. Follow below steps

1. use Edit Mode

2. Click on Bar Chart

3. on the right panel, click on Appearance > Colors and legend

4. switch on the custom Colors and then select By measure on the dropdown option

custom colors.PNG

Chanty4u
MVP
MVP

hi

try belowbg.PNG

berryandcherry6
Creator II
Creator II
Author

HI,

here i have 3 bars with different 3 condition(expression) , how could i use my above code in expression.

Please help me on this.

Chanty4u
MVP
MVP

can u share qvf?   orelse share ur expresions?