Jump to content
  • How to change the currency format dynamically for a visualization in Spotfire® Using IronPython Scripting


    Here is a sample python script to dynamically format the currency of the Value(Y) axis in a visualization

    Introduction

    Here is a sample python script to dynamically format the currency of the Value(Y) axis in a visualization

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Application.Visuals import BarChart
    from Spotfire.Dxp.Data import DataType
    from Spotfire.Dxp.Data.Formatters import *
    from System.Globalization import CultureInfo
    
    viz=barchart.As[BarChart]()
    numformattter = DataType.Real.CreateLocalizedFormatter()
    numformattter.Category = NumberFormatCategory.Currency
    numformattter.CultureInfo = CultureInfo("es-ES")
    numformattter.GroupSeparatorEnabled=True
    viz.YAxis.Scale.Formatting.RealFormatter = numformattter
     

    References

    License:    TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...