We can add reference line in the line visuals , but it will be computed on top of a visual attribute or calculated field with group level aggregation and visual aggregation ( calculation ) . Please find the additional details here in the documentation and please try aggregation as SD / Variance to get closer to slope & intercept values.
Thanks Vinod for your reply but my slope and intercept are custom values and are not related to any aggregations (i.e. SD or Variance) of the plotted data.
I have some data that I plot on x and y-axis but then I want to plot another line on top of this lineplot, with a given slope and intercept values. I assume that is not possible to do?
For this use case, I think you can create a calculated field to get y’=mx+c where you have dynamic m and c values and add this as multiline value in you chart. Keep them on the same axis to have the reference line effect.
Further to distinguish this as reference lines, you can customize the series style to dotted line and colour and use relevant identifier as reference line.
Thanks very much Prantika but what do you mean by mutiline value? I tried to add 2 fields into value well but it does not allows that… only can put one field in that well?
I have considered quantity in a X axis. Have 2 Y axis values :
y1= quantity * unitprice → this is you generic x-y plot, may not be a calculated y value
y2= quantity * unitprice - discount → your calculated ref line based on slope and intercept
Thanks Prantika, I got what the issue was with me giving 2 y axis values- I was also having another field in the color field well! If I remove the color field well, then it does allows me to take 2 y-axis values but if I add the color field well, then it only allows one y-axis value!