Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Highlighted
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

1 Solution

Accepted Solutions
whiteline
Honored Contributor II

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

14 Replies
whiteline
Honored Contributor II

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

Hi.

You can't do it directly.

The line and color belongs to the data point (the start of the segment).

The only way is to calculate the middles and add zero point appropriately.

The solution depends on weather you want to use continuous x-axis or not.

Not applicable

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

Hi,

Thanks for your reply... Adding zero points will be like adding dummy records which is not a comfortable way to have.

Can we have background of chart like background above 0 will be of red color & below it can be green? Color doesn't matters just distinguishing areas above & below reference lines needed. Any help?

Thanks

Not applicable

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

Hi,

You can do something like this

Please find the attached file...

Not applicable

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

Or, maybe like this...

Not applicable

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

Hi,

Thanks but position of reference line will chages depending on the data.

Ex: depends on customer filter data changes and so position of reference line changes.  So I can't go with putting text boxes on background.. Any other workaround?

Thanks

whiteline
Honored Contributor II

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

Hi.

You can try to use a background image with two areas of equal height.

Then set the expressions for Min/Max properly. They should be equal modulo and change dynamically according to the data selected.

Not applicable

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

Hi,

Can you please give a sample report ?..  it will give me better understanding.

Thanks

whiteline
Honored Contributor II

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

Hi.

Something like this.

Notice expressions for min and max.

Not applicable

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


Hi,

This solution is good when reference axis is not moving .. but with my data reference axis is moving... sometimes if there are all -ve values then reference line appear at top with no +ve values on y-axis.. so this solution has limited scope in my scenario.. Any other suggestion?