Oct 31, 2014

Python script for Barchart label change percentage/value

from Spotfire.Dxp.Application.Visuals import BarChart
from Spotfire.Dxp.Application.Visuals import LabelInformationType
from Spotfire.Dxp.Application.Visuals import BarChartOrientation
from Spotfire.Dxp.Application.Visuals import StackMode

barChart=viz.As[BarChart]()
if dollor=="yes":
barChart.StackMode=StackMode.Stack
barChart.SegmentLabelInformationType=LabelInformationType.Value
else:
barChart.StackMode=StackMode.Stack100Percent
barChart.SegmentLabelInformationType=LabelInformationType.Percentage



Oct 3, 2014

Show/Hide columns dynamically in table visualization in Spotfire

Create a script with 2 scripts parameters: name: showCol type: String value: "${Control}" name: tablePlot type: Visualization value: Page > Table Script: from Spotfire.Dxp.Application.Visuals import * if showCol == 'id': cols=['ID1','ID2'] elif showCol == 'type': cols=['Type1','Type2'] else: cols=['CD1','CD2'] tablePlot.As[TablePlot]().Columns.Clear() tablePlot.As[TablePlot]().Columns.AddRange(cols)