Iron Python script to set Lines & Curves Y-values column in ScatterPlot

I have a Python script as follows to change the YColumnReference in Lines & Curves in a ScatterPlot (screenshot of parameters attached)

from Spotfire.Dxp.Application.Visuals import *
sp = vis.As[ScatterPlot]()

for fm in sp.FittingModels:
      if fm.TypeId.DisplayName == "Line from Column Values":
         if fm.Line.DisplayName == "Fit Data":
            print fm.Line.DisplayName 
            print FittingModelCurve 
            fm.YColumnReference = FittingModelCurve 
            print fm.YColumnReference

which displays the following Error:

Fit Data
Modified Arps (Secant).0
Traceback (most recent call last):
File "<string>", line 9, in <module>
TypeError: expected DataColumn, got str

Any thoughts?


Image icon ycolumnreference.png33.24 KB

(1) Answer