Jump to content
  • How to get the Subsets for a visualization in Spotfire® using IronPython Scripting


    This article provides a code sample to access the subsets for a visualization and add a new marking subset

    Introduction

    This article provides a code sample to access the subsets for a visualization and add a new marking subset

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    #Lets assume the subset for a BarChart need to be accessed 
    
    vizsubsetcollection=viz.As[BarChart]().Data.Subsets
    
    #viz is a script parameter referring to the BarChart visualization
    
    for sub in vizsubsetcollection:
     print "Subset Displayname =" + sub.DisplayName + " ,Enabled=" +str(sub.Enabled) + " ,Interactive =" +str(sub.Interactive)
     
    #To add a new marking in the Barchart subsets
    
    vizsubsetcollection=viz.As[BarChart]().Data.Subsets
    vizsubsetcollection.AddDataSelection(Document.Data.Markings.Add('NewMarking'))
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...