Appearance

These IronPython scripts below show how to modify any of the Bar Chart visualization settings found on the Appearance tab of the Bar 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 Bar Chart Appearance Tab Options:

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

  1. Orientation
  2. Layout
  3. Bar width
  4. Transparency
  5. Show shadows indicating the unfiltered data
  6. Use separate color for marked items
  7. Sort bars by value
  8. Sort bar segments by value
  9. Reverse bar segment order
  10. Compensate for missing values
from Spotfire.Dxp.Application.Visuals import *

myVis = myVis.As[Visualization]()

# 1. Orientation
myVis.Orientation = BarChartOrientation.Vertical
# OR
myVis.Orientation = BarChartOrientation.Horizontal

# 2. Layout
# Equivalent to "Side-by-side bars" option:
myVis.StackMode = StackMode.None
# OR
# Equivalent to "Stacked bars" option:
myVis.StackMode = StackMode.Stack
# OR
# Equivalent to "100% stacked bars" option:
myVis.StackMode = StackMode.Stack100Percent

# 3. Bar width
myVis.BarWidth = 50  #50% width (0 - 100 allowed)

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

# 5. Show shadows indicating the unfiltered data
myVis.ShowShadowBars = True

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

# 7. Sort bars by value
myVis.SortedBars = True

# 8. Sort bar segments by value
myVis.SortSegmentsBySize = True

# 9. Reverse bar segment order
myVis.ReverseSegmentOrder = True

# 10. 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.

If you have any questions, comments, or ideas, feel free to get in touch!