Zakir Sharief Posted February 2, 2021 Share Posted February 2, 2021 Hi, I have a cross table based on the fiscal week and each cell is showing a value with the percentage. The values are not showing completely as the column width is not enough and since i have lot of columns it is gets difficult to manaully set the column width. I am using the below Iron Python script, to set the column width and i tried using differen scripts. But for some reason none of the scripts works for me. I dont know what is the issue with the script but the column width does not work. I tried using the row height and column height which are working put the column width does not work. Could you please suggest what would be an issue and how do i resolve it. Code 1: from Spotfire.Dxp.Application.Visuals import * for page in Document.Pages: for visual in page.Visuals: visualization = visual.As[Visualization]() viz = visual.As[CrossTablePlot]() if visualization != None: # print "Page Title:" + visual.Title + ", with name:" + visual.Name + ", on page " + page.Title print "Page Title:" + visual.Title + ", on page " + page.Title if page.Title=="Repair" and (visual.Title=="Internal/External OTD"): # print "hello world" print type(visual) print Resize viz.CellWidth = Resize Code 2: from Spotfire.Dxp.Application.Visuals import * vc = vc.As[CrossTablePlot]() # Crosstable visualization is the script parameter print vc.CellWidth vc.CellWidth=100 Code 3: 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 Link to comment Share on other sites More sharing options...
Raghav Rajaram Posted February 14, 2021 Share Posted February 14, 2021 Hi, Could you please try this script It worked for me (see attached image): from Spotfire.Dxp.Application.Visuals import CrossTablePlot vc = vc.As[CrossTablePlot]() vc.CellWidth = 250 -------------------------------------------------------------------------------------------------- Best, Raghav Link to comment Share on other sites More sharing options...
Zakir Sharief Posted February 22, 2021 Author Share Posted February 22, 2021 Hi Raghav, Thank you for sharing the code. I tried the code you provided it is not working for me. I am not sure what is the issue, the code i had shared earlier works on another dxp. It fails specific this one. Thanks, Zak Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now