Jump to content

ironpython script to alter plot properties specifically by visualization name in either a given page or all pages in entire spotfire file


Nivedan Nasina

Recommended Posts

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

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...