Jump to content
  • How to toggle the Legend Section of a visualization in Spotfire® using IronPython scripting.


    This article explains how to toggle the Legend Section of a visualization in Spotfire® using IronPython scripting.

    Introduction

    In DXP, a user can right click (on a visualization) > Properties > Legend > Show Legend > Check/Uncheck.

    Code Sample

    # Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Application.Visuals import VisualContent
    
    sp = vis.As[VisualContent]()  # vis is a parameter added to the script, which refers to a Scatter Plot Visualization in the document
    
    if (sp.Legend.Visible == False):
        sp.Legend.Visible = True
    else:
        sp.Legend.Visible = False
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...