8 Replies Latest reply: Jun 1, 2015 10:00 AM by Yeo Poh sai

# How to make my chart bar color Q1 alway Green color ?

Hi All

May i know how to make my chart display as below :-

1. Q1 bar = Green color

1. Q2 bar = Blue color

1. Q3 bar = Yellow color

1. Q4 bar = Red color

Now all bar are black

Paul

• ###### Re: How to make my chart bar color Q1 alway Green color ?

Hi All

Enclosed my QV Doc

• ###### Re: How to make my chart bar color Q1 alway Green color ?

=if(Quarter = 'Q1', Green(),

if(Quarter = 'Q2', Blue(),

if(Quarter = 'Q3', Yellow(),

if(Quarter = 'Q4', Red()))))

in Expression background would work

• ###### Re: How to make my chart bar color Q1 alway Green color ?

Hi Paul,

Change your background colour expression of your bar expression to the following:

if(wildmatch(YearQtr,'Q1-*'),Green(),
if(wildmatch(YearQtr,'Q2-*'),Blue(),
if(wildmatch(YearQtr,'Q3-*'),Yellow(),
if(wildmatch(YearQtr,'Q4-*'),Red()))))

HTH Andy

• ###### Re: How to make my chart bar color Q1 alway Green color ?

Hi,

You can add following expression at background color

if (quarter='Q1',green(),

if (quarter='Q2',blue(),

if (quarter='Q3',yellow(),

if (quarter='Q4',red())))

• ###### Re: How to make my chart bar color Q1 alway Green color ?

Hi Sir

I try your expression into my actual qv qvw file ,  I got the chart with many color. where i did wrong ?

• ###### Re: How to make my chart bar color Q1 alway Green color ?

Hi,

Use this expression

=
if (left(\$(ColumnDim_p),2)='Q1',green(),

if (left(\$(ColumnDim_p),2)='Q2',blue(),

if (left(\$(ColumnDim_p),2)='Q3',yellow(),

if (left(\$(ColumnDim_p),2)='Q4',red()))))

• ###### Re: How to make my chart bar color Q1 alway Green color ?

Hi All

it work fine now , after copy the expression to my actual qv doc , now it work fine. ( I cannot remember what did i try )

Thank you all

Paul

• ###### Re: How to make my chart bar color Q1 alway Green color ?

It looks like, you are using stacked bar with two dimension. So, I Don't think, coloring entire bar, which has different dimension value would work.

This would work only in case of single dimension bar graph.