Jump to content

How to loop through all visuals and check any line chart exists in active page of spotfire


Shivaganga B

Recommended Posts

You can use the below script to loop through pages and visualizations and check for any existing linechart

from Spotfire.Dxp.Application.Visuals import *

from System.Collections.Generic import List

 

 

for page in Document.Pages:

print "Page Name: "" + page.Title + "" and Number of visuals: "+str(page.Visuals.Count)

for vis in page.Visuals:

if str(vis.TypeId) == "TypeIdentifier:Spotfire.LineChart":

print vis.Title

Link to comment
Share on other sites

I got the expected result through following code:page=Document.ActivePageReference

print "Page Name: "" + page.Title + "" and Number of visuals: "+str(page.Visuals.Count)

for vis in page.Visuals:

    if str(vis.TypeId) == "TypeIdentifier:Spotfire.LineChart":

        page.Visuals.Remove(vis)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...