Jump to content

Cell width resizing doesnt work [Spotfire]


villain PARK

Recommended Posts

Hi I have a problem of resizing cell width by script

the script is in Wiki.

Title: How to style the Cross Table Cell Height/Column Header Height in TIBCO Spotfire using IronPython Scripting.

By:tdevadka

 

from Spotfire.Dxp.Application.Visuals import CrossTablePlot

vis.As[CrossTablePlot]().CellWidth=100

vis.As[CrossTablePlot]().CellHeight=50

vis.As[CrossTablePlot]().RowHeaderWidths.Item[0]=200

vis.As[CrossTablePlot]().ColumnHeaderHeights.Item[0]=40

---------------------------------------------------------------------------------

When I run this script, only Cell width doesn't change, but the others work!

I don't understand why. and even, there isno error messege.

Please Help me...

Link to comment
Share on other sites

Hi pgm7727,

 

Please consider this script. It worked for me (you can find it here: https://spotfired.blogspot.com/2014/03/change-cross-table-properties.html)

#Script to change row header, cell widths and row sorting

#viz is a Cross Table visualization script parameter

from Spotfire.Dxp.Application.Visuals import CrossTablePlot, CategoryKey

from Spotfire.Dxp.Data import SortOrder

#Get a reference of the cross table from viz param

crossTable = viz.As[CrossTablePlot]()

#Change the second RowHeader

crossTable.RowHeaderWidths[0]=150

#Resize cells

crossTable.CellWidth=100

#sort

#Change sorting

categoryKey = CategoryKey("cellValueColumnToSort")

crossTable.SortRowsCategory = categoryKey

crossTable.SortColumnsOrder = SortOrder.Descending

crossTable.SortRowsOrder = SortOrder.Descending

#Reset sorting

crossTable.SortRowsCategory = None

Kind regards,

David

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 years later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...