Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

barchart

Hi all

I have one requirement

i have to create a bar chart and half of the bars should show one color remaining half bars should show another color

how can we do  plz help

Regards

Panireddy

1 Solution

Accepted Solutions
jsingh71
Partner - Specialist
Partner - Specialist

hi,

Go to chart properties the Expression Tab and expand + sign from your dimension and select background color.

After that put this expression:

  if(FieldIndex('Month',Month)>6,Green(),Red())

bar1.png

It will solve your problem and you get output like

bar.png

View solution in original post

12 Replies
Not applicable
Author

Hi,

CAn you please eloborate your requirement ....with sample file or data

Regards

Nani

Not applicable
Author

Hi Panireddy,

The easiest option is to set the colors in "Colors" tab.

Right click on the chart, go to Properties--Colors tab and in the "Data Appearance" section you can customize the colors for the bar.

Hope this helps. Otherwise, please add a sample file.

MK_QSL
MVP
MVP

Creat a bar char

example

Dimension = Customer

Expression1 = SUM(Sales)/2

Expression2 = SUM(Sales)/2

Now go to Style tab and select Stacked.

UPDATE : Please check enclosed file...

sunilkumarqv
Specialist II
Specialist II

Hi Pn Reddy,

Go to properties - Style - Choose -subtype as stacked it works but should have  more then on expression in your chart

If not these .more specific what you want so it easy to solve 

jsingh71
Partner - Specialist
Partner - Specialist

Hi,

First you add two expressions and after that go to chart properties and select stacked option.stacked.png

Not applicable
Author

Hi Nani

Capture.PNG.png

12 bars are there my requirement is 6 bars should show green and another 6 bars should show yellow how can do

jsingh71
Partner - Specialist
Partner - Specialist

hi,

Go to chart properties the Expression Tab and expand + sign from your dimension and select background color.

After that put this expression:

  if(FieldIndex('Month',Month)>6,Green(),Red())

bar1.png

It will solve your problem and you get output like

bar.png

Not applicable
Author

Hi

Here 12 bars are there my requirement is 6 bars should show green and another 6 bars should show yellow how can do

Capture.PNG.png

jsingh71
Partner - Specialist
Partner - Specialist

I alredy told you, instead of Red() use Yellow().