Jump to content
  • How to set the Color Mode to Gradient and specify the Breakpoints with specific colors for a Bar Chart Visualization in Spotfire® Using IronPython Scripting


    This article describes how to programmaticlaly set the Color Mode to Gradient and  specify the Breakpoints with specific colors in a Bar Chart Visualizaiton.

    Introduction

    This article describes how to programmatically set the Color Mode to Gradient and  specify the Breakpoints with specific colors in a Bar Chart Visualization.

    Code Sample

    # Copyright © 2019. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Data import *
    from System.Collections.Generic import List
    from Spotfire.Dxp.Application.Visuals import *
    from System.Drawing import Color
    from Spotfire.Dxp.Application.Visuals.ConditionalColoring import Coloring, ContinuousColorRule ,ConditionValue,IntervalMode
    
    vc = vis.As[BarChart]()
    
    colorRule = vc.ColorAxis.Coloring.Clear()
    cr = vc.ColorAxis.Coloring.AddContinuousColorRule()
    
    cr.IntervalMode = IntervalMode.Gradient
    
    cv1 = ConditionValue.CreateLiteral('-18724.86')
    cv2 = ConditionValue.CreateLiteral('-30099.13')
    
    cr.Breakpoints.Add(cv1,Color.Blue)
    cr.Breakpoints.Add(cv2,Color.Yellow)
     

    References

    License: TIBCO BSD-Style License

    Back to IronPython Scripting in Spotfire Examples:  https://community.spotfire.com/s/article/IronPython-Scripting-in-Spotfire

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...