Remove all bar chars from a page
/Description: Remove all bar charts from a page.
Assumptions: An optional 'myPage' page type script parameter.
Warning: Backup Spotfire files before removing visualizations.
from Spotfire.Dxp.Application.Visuals import VisualTypeIdentifiers #Pick one of the following Page reference options: #myPage = Application.Document.Pages[0] #Page index method #myPage = Application.Document.ActivePageReference #Active page method #myPage as a page type script parameter #Script parameter method #Remove all bar charts from a page for myVis in myPage.Visuals: if (myVis.TypeId == VisualTypeIdentifiers.BarChart): myPage.Visuals.Remove(myVis)