Jump to content
We've recently updated our Privacy Statement, available here. ×

How to change Marking on Data Limitting option in many Visualizations


Ringga Ringga

Recommended Posts

I have several visualization chart in one page. let's say I have 2 line charts, 1 bar chart and 1 combination chart. Currently it's limitted by MARKING_A. I'm curious if we can create python script to change the marking (let say MARKING_B) for all of the visualizations at the same time.

Highly appreciate if someone can help on this issue.

thanks.

regards,

Ringga

Link to comment
Share on other sites

  • 2 months later...

Below is a sample script

from Spotfire.Dxp.Application.Visuals import *

 

#Access current active page

page=Document.ActivePageReference

# or to access a specific page

#page=Document.Pages[1]

 

# Specify the marking you want to set

currentMarking = Document.Data.Markings['Marking_A']

newMarking=Document.Data.Markings['Marking_B']

 

for visual in page.Visuals:

if visual.TypeId != VisualTypeIdentifiers.HtmlTextArea:

vis=visual.As[VisualContent]()

vis.Data.Filterings.Remove(currentMarking)

vis.Data.Filterings.Add(newMarking)

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