有没有一种方法可以通过Java或Python脚本设置Spotfire Table可视化列宽。我可以手动更改列宽,但只要通过属性控件更改了值,它就会再次重置。我需要设置常量列宽。提前谢谢。
发布于 2018-08-09 22:03:23
问得好!您可以添加一个IronPython脚本(我不相信使用Javascript可以做到这一点,除非您是某种向导,或者讨厌自己:)。
我将把所有示例放在一个代码片段中,但很明显,您一次只需要执行其中一个循环。代码片段需要一个名为viz的参数,该参数的值是您希望修改的TablePlot可视化。
from Spotfire.Dxp.Application.Visuals import TablePlot
v = viz.As[TablePlot]()
# increase all column widths by 10 pixels
for col in v.Columns:
col.Width = col.Width + 10
# set all column widths to 100 pixels (the default value)
for col in v.Columns:
col.Width = 100
# set the width of a specific column to 50 pixels
for col in v.Columns:
if col.Name == "My Column":
col.Width = 50发布于 2018-08-09 18:04:26
from Spotfire.Dxp.Application.Visuals import TablePlot
# Tab is the (Visualization) parameter passed to the script specify the table to work on
dataTable= Tab.As[TablePlot]().Data.DataTableReference
# Get a handle to the Table plot
table = Tab.As[TablePlot]()
# Get the ColumnCollection for the Table plot
columns = table.TableColumns
# Size all of the columns
for x in columns:
x.Width = 200https://stackoverflow.com/questions/51755918
复制相似问题