Jump to content
  • How to set Stack mode in Bar Chart visualizations using IronPython script in Spotfire®


    Script that allows to control stacking (Stack mode) in Bar Chart visualizations depending upon a Document Property value.

    Introduction

    Script that allows to control stacking (Stack mode) in Bar Chart visualizations depending upon a Document Property value.

    Code sample

    # Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Application.Visuals import BarChart, StackMode 
    
    for vis in Document.ActivePageReference.Visuals:
        if  vis.Title == "Bar Chart":
            vc = vis.As[BarChart]()
            if Document.Properties["stackmode"] == '0':
                vc.StackMode = StackMode.None
            elif Document.Properties["stackmode"] == '1':
                vc.StackMode = StackMode.Stack
            elif Document.Properties["stackmode"] == '2':
                vc.StackMode = StackMode.Stack100Percent
    #"stackMode" is name of Document Property.
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...