Appearance

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

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 Combination Chart Appearance Tab Options:

This IronPython script shows how to change the following, in order from top to bottom in the user interface:

  1. Sort x-axis by
  2. Transparency
  3. Use separate color for marked items
  4. Side-by-side or stacked bars layout
  5. Reverse bar segment order
  6. Set bar width
  7. Set line width
  8. Show (or hide) line markers
  9. Set marker size
  10. Draw as step lines
  11. Break lines on empty values
  12. Compensate for missing values
from Spotfire.Dxp.Application.Visuals import *

myVis = myVis.As[Visualization]()

# 1. Sort x-axis by:
# The simplest scenario, with a single text category
myVis.SortBy = CategoryKey("Category A")
# OR
# Use no sorting - The UI dropdown shows: (None)
myVis.SortBy = CategoryKey()
# OR
# When using a hierarchy of text categories
# The UI dropdown would show something like: Category A >> Group B
myVis.SortBy = CategoryKey("Category A", "Group B")
# OR
# When using a hierarchy of mixed type categories (e.g. text and number)
# The UI dropdown would show something like: Category A >> 4
myVis.SortBy = CategoryKey("Category A", 4)

# 2. Transparency
myVis.Transparency = 0.5  #50% transparency (0.0 - 1.0 allowed)

# 3. Use separate color for marked items
myVis.UseSeparateColorForMarkedItems = True

# 4. Side-by-side or stacked bars layout
# Equivalent to "Side-by-side bars" option:
myVis.Bars.StackMode = StackMode.None
# OR
# Equivalent to "Stacked bars" option:
myVis.Bars.StackMode = StackMode.Stack

# 5. Reverse bar segment order
myVis.Bars.ReverseSegmentOrder = True

# 6. Set bar width
myVis.Bars.Width = 50  #50% width (0 - 100 allowed)

# 7. Set line width
myVis.Lines.Width = 3  #Width in pixels (1-10)

# 8. Show (or hide) line markers
myVis.Lines.ShowMarkers = True

# 9. Set marker size
myVis.Lines.MarkerSize = 20  #Size in pixels (1-100)

# 10. Draw as step lines
myVis.Lines.SteppedLines = True

# 11. Break lines on empty values
myVis.Lines.BreakOnEmpty = True

# 12. Compensate for missing values
myVis.CompensateForMissingTimeSeriesValues = True
Welcome!

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