Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
danosoft
Specialist
Specialist

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
Creator
Creator

Try this,

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

Graph_Color.png

View solution in original post

7 Replies
prma7799
Master III
Master III

Try this

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


or


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

danosoft
Specialist
Specialist
Author

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

Gysbert_Wassenaar

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.


talk is cheap, supply exceeds demand
mostwanted123
Creator
Creator

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

danosoft
Specialist
Specialist
Author

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

mostwanted123
Creator
Creator

Try this,

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

Graph_Color.png

danosoft
Specialist
Specialist
Author

Thanks you all right now!