Spotfire-IronPython:从 Document.Pages 获取可视化

Spotfire-IronPython: Fetch visualization from Document.Pages

假设我在每个页面都有一个循环是 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]()

此致,

是这样的吗?

#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