简体   繁体   中英

Spotfire-IronPython: Fetch visualization from Document.Pages

Say I have a loop through every page is Spotfire, how can I fetch the visualization per page?

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]()

Best Regards,

Something like this?

#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'

You have to set up Document Properties to show the results, unless you are in the console and reading the output.

Please see this page for more information: https://community.tibco.com/wiki/loop-through-pages-and-visualization-tibco-spotfirer-using-ironpython-scripting

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM