Jump to content

Selecting Filter Schemes for visualisations with IronPython


Matthias Garbs

Recommended Posts

Hello everybody

In the properties of a visualization I have the option under "Limiting data using filters" to select a selection of filter schemes for this visualization. I recently had the problem that I wanted to change the selection of these filter schemes whenever myDocument Property changes its value. But I have not found a way how I can use IronPython to activate or deactivate the individual schemes for a visualization. I finally found a way to solve my specific problem by switching the ActiveFilteringScheme of the page.

However, I would still like to know how I can activate and deactivate individual schemes, since my solution would no longer be possible with more filter schemes.

Link to comment
Share on other sites

You can use the follow python code :

 

from Spotfire.Dxp.Application.Visuals import *

from Spotfire.Dxp.Data import *

 

myVis = myVis.As[Visualization]()

 

# Add or remove specific filters:

myVis.Data.Filterings.Add(Document.Data.Filterings["Filtering scheme2"]) #Add filter

myVis.Data.Filterings.Remove(Document.Data.Filterings["Filtering scheme"]) #Remove filter

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