12 Replies Latest reply: Sep 15, 2014 5:05 PM by QV Learner

# chart help needed

Hi,

I have data in the qvw. I have to show bar chart based on the due days.

if days > 0 = red color in bar chart

if days = 0 = green color

if days < 0 purple colour on bar chart for that date

one day should show one line

can anybody help.

• ###### Re: chart help needed

on the expression tab expand the + and enter the following for 'background color'

if ( Only (Duedays) > 0 , lightred(), if ( Only (Duedays) = 0 , green(), if( Only (Duedays) <  0,  rgb(196,178,214)) ))

• ###### Re: chart help needed

Hi Jonathan,

Thank you for your quick reply, in the above example it is not showing if days = 0 = green color remaining 2 conditions are working. If i select DueDays as '0' no preview is showing. Please help me.

Thanks,

• ###### Re: chart help needed

on the presentation tab, uncheck 'supress zero values'

but.... since the bar will have a value of 0 it will have no height ! and you won't see any color !

• ###### Re: chart help needed

May be because when 0 days, chart element is too small to be seen and also, even if you uncheck 'supress zero', you won't see the color, as there is 0 as value.

• ###### Re: chart help needed

Hi Jonathan,

Sorry, I have not mentioned my requirement clearly,

Example  i need 3 colors in 1 days Example i have data like this

 2361, -4, 11/09/2014 2362, -20, 11/09/2014 2363, 25, 11/09/2014 2364, 0, 11/09/2014

In the above example i need to get 1 bar chart with different colors + value with purple -Ve vale with Red and 0 value with green.

• ###### Re: Re: chart help needed

Hi Jonthan,

Any help?

I need bar on Count of the Records (if same date 5 records, e.g. 2 positive, 2 negative, 1 with zero; then the bar should show as below for that date). And the colour is based on due days.

Thanks,

• ###### Re: chart help needed

Bar length is Zero to color up. So obviously you cant see.

Thank you

Suraj

• ###### Re: Re: chart help needed

Hi Suraj,

I need bar on Count of the Records (if same date 5 records, e.g. 2 positive, 2 negative, 1 with zero; then the bar should show as below for that date). And the colour is based on due days.

Thanks,

• ###### Re: Re: chart help needed

Can any one help?

• ###### Re: Re: Re: chart help needed

I switched the approach to count the IDs

You need 3 expressions each with their own background color

1st expression:  count(   if (  Duedays<0, ID))      ( background color:   green())

2nd expression:  count(   if (  Duedays>0, ID))      ( background color:   red())

3rd expression:  count(   if (  Duedays=0, ID))      ( background color:     rgb(196,178,214))

and change the style of the chart to stack

also use 'DueDate' as the dimension

• ###### Re: Re: chart help needed

Hi Jonathan,

Thanks for the help, yes that is what I want.

Thanks again.

• ###### Re: Re: Re: chart help needed

somethin like this?