Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional coloring to line chart based on reference line in line chart

Hi,

I have a line chart where I am using reference line. what I need to do in chart is Lines which are above reference 0 should be red & lines below should be green. I am attaching a test report so you might get a better idea.

Thanks

14 Replies
whiteline
Master II
Master II

Hi.

If you know the reference value it's not hard to apply linear transformation to the min/max expressions so that the boundary match the reference line.

ThornOfCrowns
Specialist II
Specialist II

Nice work, many thanks.

Not applicable
Author

Thanks a lot .. !!!

Anonymous
Not applicable
Author

Here's a different approach which allows you to have as many color segments as you like, allows for areas changing along the x-axis, and isn't sensitive to scaling:

  1. Watch this video which explains how to combine a line chart with stacked bars.
  2. Create dummy data to represent your different color areas and plot this data as stacked bars. Make the bars wide, so there's no whitespace between them.
  3. Plot your data as a line, and hey presto --- we're done!

(I can give an example qvw if someone's interested.)