Question
How to divide a scatter plot with any linear line.
For example, in the below scatter plot, how to manually input 2 dots and divide the it into 2 parts with color in the mark or in the background.
How to divide a scatter plot with any linear line.
For example, in the below scatter plot, how to manually input 2 dots and divide the it into 2 parts with color in the mark or in the background.
AVG([Y2]-[Y1])/AVG([X2]-[X1])3. Create a Linear line function to divide the marks into two parts -- "IN" and "OUT".
IF SUM([Quantity])>=[! Slope]*SUM([Sales])+([Y2]-[! Slope]*[X2]) THEN "IN" ELSEIF SUM([Quantity])<[! Slope]*SUM([Sales])+([Y2]-[! Slope]*[X2]) THEN "OUT" END4. Add the calculation in Step 3 to [Color] Mark.
AVG([Y2]-[Y1])/AVG([X2]-[X1])3. Create a calculation to calculate the Y of the Linear line graph.
IF INDEX()%2 = 0 THEN AVG([Y1]) ELSEIF INDEX()%2 = 1 THEN AVG([Y2]) END4. Create a Linear line function.
SUM([Sales])*[! Slope]+WINDOW_MIN([! Y])5. Add the calculation in Step 4 to [Rows] Shelf and set it as a dual-axis.