Jump to content
  • How to AddColumns to ColorScheme Groups in Spotfire® Using IronPython Scripting


    This script can be used to add columns to a specific color scheme group

    Introduction

    This script can be used to add columns to a specific color scheme group

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Application.Visuals import VisualTypeIdentifiers, ConditionalColoring as cc, TablePlot, CategoryKey 
    import System.Drawing.Color as Color
    
    visuals = Document.ActivePageReference.Visuals
    
    for vis in visuals:
       if (vis.Title == "Table"):
            # Get the correct plot.
          tp = vis.As[TablePlot]()
          # We start by adding color category
          color = tp.Colorings.AddNew("New Category")
          categoryKey = CategoryKey("Sales")
    	  # Add mapping to Column name
          tp.Colorings.AddMapping(categoryKey, color)
     

    References

    License:  TIBCO BSD-Style License

    Back to IronPython Scripting in Spotfire® Examples


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...