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

2 comments:

  1. I tried this code however it resets all the configuration once you switch from pie to bar. In my case i have used document property in bar chart, after switching the property will become static instead of dynamic. Could you please fix this issue. Thanks in advance.

    ReplyDelete
  2. I have recently started a blog, the information you offer on this website has helped me greatly. Thanks for all of your time & work.
    wordpress
    blogspot
    youtube
    កាស៊ីណូអនឡាញ

    ReplyDelete