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:
- Bar width
- Show shadows indicating the unfiltered data
- Use separate color for marked items
- Sort bars by value
- Sort bar segments by value
- Reverse bar segment order
- 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
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!