说我在每个页面上都有一个Spotfire循环,如何获取每个页面的可视化效果?
for pg in Document.Pages:
print pg.Title
myPanel = pg.ActiveFilteringSelectionReference
print '\t' + myPanel.Name
# How to fetch vis from a Page? Assume each page has only one visualization
viz=vis.As[ScatterPlot]()
最好的问候,
答案 0 :(得分:2)
像这样吗?
#loop through all pages and visualizations, and print the Type of each visualization
for p in Document.Pages:
print (p.Title)
Document.Properties["scriptOutput"]+=p.Title+'\n'
for v in p.Visuals:
print ('-' + v.Title + '('+ v.TypeId.Name +')')
Document.Properties["scriptOutput"]+='-'+v.Title+'('+v.TypeId.Name+')\n'
除非您在控制台中并读取输出,否则必须设置文档属性以显示结果。
请参阅此页面以获取更多信息:https://community.tibco.com/wiki/loop-through-pages-and-visualization-tibco-spotfirer-using-ironpython-scripting