Column Width on Data Table, Cross Table and Graphical Table

Graphical Table Column Width
#gt is a graphical table vis script parameter
from Spotfire.Dxp.Application.Visuals.Miniatures import GraphicalTable
graphicalTable = gt.As[GraphicalTable]()
#toggle height between 100 and 300
graphicalTable.HeaderColumnWidth = 100 if graphicalTable.HeaderColumnWidth==300 else 300

Cross Table Column Width
#ct is a cross table vis script param
from Spotfire.Dxp.Application.Visuals import CrossTablePlot
crossTable = ct.As[CrossTablePlot]()
#toggle height between 100 and 300
crossTable.RowHeaderWidths[0]=100 if crossTable.RowHeaderWidths[0]==300 else 300

Regular Table Column Width*
*Not sure how to change the width, but works if you make sure to wrap text header and change its height.
#dt is a table vis script param
from Spotfire.Dxp.Application.Visuals import TablePlot
tablePlot = tp.As[TablePlot]()
tablePlot.WrapHeaderText = True
#toggle height between 1 and 2
tablePlot.HeaderHeight = 1 if tablePlot.HeaderHeight==2 else 2


No comments: