Labels

Toggle visualization type

from Spotfire.Dxp.Data import * 
from Spotfire.Dxp.Application.Visuals import *

if viz.TypeId == VisualTypeIdentifiers.LineChart:
 viz.TypeId = VisualTypeIdentifiers.BarChart 
elif viz.TypeId == VisualTypeIdentifiers.BarChart:
 viz.TypeId = VisualTypeIdentifiers.LineChart

Input:
viz (Visualization): The visualization that you want to toggle between a different visual type.

This script will toggle a visualization between a Line Chart and a Bar Chart.  Other visualization types can also be used.

Attribution: Chris S. from TIBCOmmunity