15 Replies Latest reply: Jul 29, 2016 6:56 PM by Nathaniel Anderson

# Reference Line

Hi

I wonder if it's possible in a scatter plot the line : Y = X to share my plot thanks to the first diagonal line.

thanks for any help

Jean-Jacques

• ###### Reference Line

Hi, does anyone know how to do a diagonal reference line in a scatter chart?

• ###### Reference Line

Here are some X=Y Diagonal Lines in a Scatter Plot. I'm going to keep working on it, but right now for it to work you need to have a point selected that is at (0,0) for it to work, but if you naturally don't have this, you should be able to generate it in the script.

Regards.

• ###### Reference Line

Hi Jean-Jacques,

There is a fairly simple solution to your problem; you add a linear reference line to a fouth expression. In an XY plot, the first expression represents the X-axist, the second the Y axis and the third the size.

If you add a fourth expression that is a copy of the first, i.e. the x axis it will not be visible, but it is part of the solution. When you add a liniar reference line to the fourth expression, it will be drawn as X = Y as that is its expression.

Hope this helps,

Christian

• ###### Reference Line

Thanks Christian!

Brilliant solution! This really helped me as well!

/Elsy

• ###### Reference Line

Waou ! very tricky !

thanks Christian ! it's nice to wait almost 2 years for a such answer.

JJ

• ###### Re: Reference Line

Hi,

I know it's been more than a year but...

Just a hint, if you show the equation for the linear line you can see that it's not exactly X=Y but close enough (y = 1x+1.81e-12 in my case).

Regards,

Carlos

• ###### Re: Reference Line

Hi Christian,

It's working well.

Thanks!!!!

• ###### Re: Reference Line

Hi Christian:

I am new to Qlikview and trying to draw a X=Y reference line.

What do you mean by 'liniar reference'? And how to add a reference to a specific dimension?

Thank you

PC

• ###### Re: Reference Line

"Linear reference line" -- I think he means on the "Expressions" tab, where you added the 4th dimension, to use the "Linear" Trendline (bottom-left corner)

• ###### Re: Reference Line

Thanks for this solution.  Exactly what I needed!

• ###### Re: Reference Line

I am glad to hear, Lorna! Thank you!

• ###### Re: Reference Line

Hi I realise this thread isnt being watched anymore but ive tried the above method and cant seem to get it to work,

I have a scatter plot and in expression clicked advance, added a 3rd expression as = 1 for size (I actually dont want to do this becuase it makes my circles too large) and then Ive added a fourth the same as the first and nothing happens.

I know the expression must be correct as the chart works but here it is just incase,

IF(SwitchOnOffVariables.Group.onOffState <> 'STANDBY' and

RampDataFilteringOutput.Loopp1.sORLoopK > 35 and

RampDataFilteringOutput.Loopp2.sORLoopK > 35,

RampDataFilteringOutput.Loopr1.qRLoopK + RampDataFilteringOutput.Loopr2.qRLoopK)

I must have understood you process incorrectly as iot worked for everyone else,

thanks for any help

• ###### Re: Reference Line

Please start a new thread, rather than necro'ing an old post with a correct answer, as many peoplem will see the question marked answered and not look at it.

• ###### Re: Reference Line

Hi Samuel:

After adding the fourth expression, you need to check the "Linear" check box for the fourth expression in the "Trendlines" Session which is located at the left bottom conner of "Expression" Tab.

It works for me. Not sure if there is another way to get around the third expression.

Hope this would help.

Cheers,

PC

• ###### Re: Reference Line

Thanks Chirstian!  Your Solution worked out perfectly!