Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
steffen_winkler
Contributor
Contributor

draw reference lines in scatter charts

Hi community,

i have following issue i can´t solve by my own.

i have a scatterchart with

dimensions: id --> so, every dot is a unique id

expression: mostrecent month (x-axis), revenue (y-axis),

i was able to draw a trend line based on second expression "revenue". But this is a dynamic trendline, which changes with the set of selected values. (the line in the picture)

What i am trying to achieve is a custom reference line which is based on a linear equation and should not change with the selected values.

i already tried it in "Chart Properties" --> "Presentation" --> "Reference Lines", but i was only able to draw, horizontal or vertical lines but no diagonal lines or lines based on a linear equation.

Hope that somebody can help

regards steffen

2 Replies
balabhaskarqlik

May be one of the scenario from below:

1) Change the expression like:

linest_m(total aggr(if(sum(sales),sum(Sales)),OrderDate),OrderDate)* 

only({1}OrderDate)+linest_b(total aggr(if(sum(Sales),sum(Sales)),OrderDate),OrderDate)

In Expression tab: select Linear option.

2) Add 2 reference lines:

one for x-axis, select percentile - provide some value.

second for y-axis, select expression - provide some value.

Now check the chart.

3) One more expression:

You can add one more expression to your chart as 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 linear reference line to the new expression, it will be drawn as X = Y as that is its expression.

steffen_winkler
Contributor
Contributor
Author

HI Bala,

thank your your suggestions

1)  i think that doesn`t work for me, since i still need to show the dots.

2) as i said, it´s only possible to draw, horizontal or vertical lines, but no diagonal or based on a linear equation

3) i think that could be my solution! Thank you! There is just one more issue. the line should be constant, based on my expression. So if select some Ids the trendline should not change. How can i solve it, that the trendline doesn´t change by selecting filters?

Regards Steffen