Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Color of line graph changing when going up or down


In a line chart I am trying to have the color change according the graph going up or down. So the line going up should be red and the line going done should be green. I know that there is this backgrounf color function, but I have no idea how to implement this.

Thanks a lot for your help, Sandra

4 Replies
MK_QSL
MVP
MVP

Can you please provide some sample data or your sample apps for this question?

sushil353
Master II
Master II

Hi,

Say for sample data:

LOAD * Inline

[

Dim,v1,v2

x,1,4

y,2,3

z,3,2

];

I have a line chart with expression sum(v1) and sum(v2)

Then Try below expression in background of expression:

=if(alt(Above(sum(v1)),0)>sum(v1),Green(),red())

Anonymous
Not applicable
Author

You can specify any condition as

if(sum(Data)>150000,red(),green())

Not applicable
Author

Hi Sushil,

this is kind of working, but not for a line chart.

pic1.PNG

In the table you can see that the calculation is working

pic2.PNG


Any other idea? Thank you !