Shivaganga B Posted October 14, 2019 Share Posted October 14, 2019 How to loop through all visuals and check any line chart exists in active page of spotfireand if there is no chart exists, add new 4 charts. Else delete the existing charts. Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted October 15, 2019 Share Posted October 15, 2019 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 More sharing options...
Shivaganga B Posted October 16, 2019 Author Share Posted October 16, 2019 HI Shandilya, Thanks for the code. But it loops through out the dashboard and showing the results. I need the Linechart list for current active page and if exists, delete that linechart. Thanks, Shivaganga Link to comment Share on other sites More sharing options...
Shivaganga B Posted October 16, 2019 Author Share Posted October 16, 2019 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now