Casual Tableau Add Line To Scatter Plot
Adding The Background Image To The Scatter Plot Now we can return to our scatter plot and lay the image weve just created as the backcloth to our view.
Tableau add line to scatter plot. Right click on the Budget Sales axis y and select Add Reference Line. In the Line Value choose Create a new Parameter and name it Select Population Over 65 Reference Line for example. On the Marks card for SUM Reference Line change the mark type from Automatic to Line.
This will give you a quadrant like view. Where M the slope of the line b the y-intercept and x and y are the variables. In order to calculate a straight line you need a linear equation ie.
Create two calculations for reference lines. Right-click anywhere on the white region on your scatter-plot and click on Format. Set the Reference line Value to the Budget Parameter.
Computed values can be based on a specified field. Right click on the Sales axis x and select Add Reference Line. Actually there is but it is hidden and doesnt show up in the calculation box.
The Format panel will open on the left-hand side on your Tableau window. Please select the Trend Lines and click on the Show Trend Lines option. Set up the axes.
Reference Lines - You can add a reference line at a constant or computed value on the axis. Heres how its done in Tableau using above or below average as my segmentation logic. This will give the marks in the chart further context than just the two axes plus any other characteristics youve assigned such as colour size or label.