Customer Banners (Ads) - SpiceUp. AX and SpotfireX Disclaimer



If you find this site useful and you want to support, buy me a coffee   to keep this site alive and without ads.

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


2 comments:

KING said...

how to show/hide some of columns from table visualization

Jose Leviaguirre said...

Hello King, One way is to use the TableColumCollection from the TablePlot.TableColumns property to clear and then add those columns you are interested to see.

Check out this post*

https://spotfired.blogspot.com/2015/08/create-tableplot-and-add-columns.html