The Straight Line Fit from Lines & Curves could be customized and shown/hidden as per requirement.
Below is a Scatter plot used to add a straight line fit.
Make sure that the Straight Line Fit is the first fitting model in Lines & Curves (to use the script below).
Add a button with script as below. In the previous step, since the first fitting model is our Straight Line Fit, we refer it in the script as FittingModels. If your Straight Line is the second fitting model, you could refer it as FittingModels and so on. Additionally, we need to pass the Scatter Plot as Visualization input vis to the script.
IronPython Script: from Spotfire.Dxp.Application.Visuals import ScatterPlot for fm in vis.As[ScatterPlot]().FittingModels: for vis in Application.Document.ActivePageReference.Visuals: if vis.Title == "Sales by Profit": if vis.As[ScatterPlot]().FittingModels.Enabled == True: vis.As[ScatterPlot]().FittingModels.Enabled = False else: vis.As[ScatterPlot]().FittingModels.Enabled = True
Now you can use the button to toggle and show/hide the regression line.