Nivedan Nasina Posted December 20, 2020 Share Posted December 20, 2020 Please help: I have 36 scatterplots in a page. I would like to alter the color scheme in 24 of them. say all 24 of them have "_abc" as part of their name. how can i do it programatically using ironpython script - read each viz name andusing logic to filter it out and apply the colot scheme looking for some examples of code to apply logic on viz names. ( i already have the script to change the color scheme by individual viz - obviously its painful to do it 24 times per page(i have 12 such pages)) I know that its possible to print the names of all visualizations in a page or all pages using the following scripts i found from the TIBCO spotfire community help: ###################################### from Spotfire.Dxp.Application.Visuals import * for visual in Document.ActivePageReference.Visuals: print visual.Title ###################################### #Writing output to a Document Property that could be shown in a html/text area in Spotfire Document.Properties["scriptOutput"]='' #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' ###################################### Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted December 21, 2020 Share Posted December 21, 2020 In the above code where you are iterating over visuals in each page ofthe document , you can add the below IF condition to filter out the visuals based on the title for v in p.Visuals: if "_abc" in v.Title: print "found visual" #add the code for color scheme here Link to comment Share on other sites More sharing options...
Nivedan Nasina Posted December 22, 2020 Author Share Posted December 22, 2020 Shandilya-Thanks for the help. let me see if i can get my task accomplished with that. 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