Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

d_caprelli
Contributor II

Graph bar colour

Hi i want to do a graph bar colour base -/+ value,

for example if my value is > 0  i want the bar is GREEN

if my value is < 0 i want the bar is RED

can be possible? i tried to did it with calculated colour (like you see in image) but it not start... what i do wrong?

this is the fx i used: =if(FATTURATO_IMPONIBILE>0,'#000040','#000000');

1 Solution

Accepted Solutions
mostwanted123
Contributor

Re: Graph bar colour

Try this,

if(Expression Label < 0,red(),green())

Graph_Color.png

7 Replies
prma7799
Honored Contributor III

Re: Graph bar colour

Try this

f(FATTURATO_IMPONIBILE>0,Green(),red());


or


f(sum(FATTURATO_IMPONIBILE)>0,Green(),red());

d_caprelli
Contributor II

Re: Graph bar colour

Hi, thanks for reply, no it not start, but i think the function is correct, is like the graph bar not take me the calculated colour but it take the base colour, as you see in the picture i attached

Re: Graph bar colour

The color definitions on the Colors tab are defined at the chart level, not the row level. FATTURATO_IMPONIBILE does not have a single value at the chart level so the calculation doesn't work. You can go to the expressions tab and click on the + character in front of the expression to show a list of options you can change. Click on the Background Color option and then enter your color calculation expression in the Definition field.

mostwanted123
Contributor

Re: Graph bar colour

Try this,

Go to Properties ---> Go to Expression Tab ---> Expand the Expression tab ---> Go to Background Color

In the Background Color, write the condition

if(Expression Label >0,Green(),Red())

For ex, if(Sales > 0, Green(), Red())

where Sales is label for the condition - Sum(Sales)

Regards,

Pratik

d_caprelli
Contributor II

Re: Graph bar colour

i try it but my graph not change... perhaps i need to refresh the graph? how?

mostwanted123
Contributor

Re: Graph bar colour

Try this,

if(Expression Label < 0,red(),green())

Graph_Color.png

d_caprelli
Contributor II

Re: Graph bar colour

Thanks you all right now!