This article provides a sample script on how to add a "Line from column values" fitting model to a visualization
Introduction
This article provides a sample script on how to add a "Line from column values" fitting model to a visualization
Code Sample
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license. from Spotfire.Dxp.Application.Visuals import * from Spotfire.Dxp.Application.Visuals.FittingModels import * #get the data table table=Document.Data.Tables["myDataTable"] # define vis as script parameter referring to your visualization lchart=vis.As[ScatterPlot]() # Add a ColumnValuesLine fitting model fModel=lchart.FittingModels.AddNew(ColumnValuesLine) #Define the model fModel.DataTableReference=table fModel.XColumnReference=table.Columns["columnA"] fModel.YColumnReference=table.Columns["columnB"] #get the ReferenceCurve line=fModel.Line #set a custom name to the line line.CustomDisplayName="myLine" line.IsBackground=True line.LineStyle=LineStyle.Dot
References
- API Reference: ScatterPlot
- API Reference: FittingModelCollection
- API Reference: ColumnValuesLine
- API Reference: ReferenceCurve
License: TIBCO BSD-Style License
Recommended Comments
There are no comments to display.