Line By

These IronPython scripts below show how to modify any of the Line Chart visualization settings found on the Line By tab of the Line Chart Properties dialog box in the Spotfire user interface.

In each of the scripts below, it is assumed that the MyVis variable references the targeted visualization. See here for more information about referencing visualizations.

Change Line By Expression

The IronPython script below updates the custom expression used in the “Show one line for each” input box.

from Spotfire.Dxp.Application.Visuals import *

myVis = myVis.As[Visualization]()

# Single column:
myVis.LineByAxis.Expression = "<[Column 1]>"
# OR
# Pattern for multiple columns:
myVis.LineByAxis.Expression = "<[Column 1] NEST [Column 2]>"


If you aren't sure how to write a specific custom expression correctly from scratch, start by building the expression interactively using the Spotfire user interface. Once your custom expression is working correctly, right-click on the custom expression input box selector(s) and choose Custom Expression. You can then copy the expression shown into your IronPython script.


The purpose of this website is to provide a comprehensive, accurate, and efficient IronPython reference for Spotfire developers.