Jump to content
We've recently updated our Privacy Statement, available here. ×
  • How to read and set values for axis range in multiple scales mode in Spotfire® Using IronPython Scripting


    A python script can enable us to read and set values for axis range in multiple scales mode.However it is not possible to read the automatic value set by the axis heuristics. If the user has not manually set the range, the value is always be null.Here is an example on how to read and write the axis range values in multiple scales mode

    Introduction

    A python script can enable us to read and set values for axis range in multiple scales mode.However it is not possible to read the automatic value set by the axis heuristics. If the user has not manually set the range, the value is always be null.Here is an example on how to read and write the axis range values in multiple scales mode

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    #Let's assume there are 2 columns "Sum([Col1]), Sum([Col2])" on the y-axis of a line chart. Color is set to (Column Names). The multiple scales for 
    #each color is turned on. Notice that there is a possibility to set different scale ranges using the drop down in the individual scale settings 
    #part of the property page. The naming of the two axes there are the same as the display name of the expressions on the axis (in this case Sum(Col1) and Sum(Col2)).
    
    from Spotfire.Dxp.Application.Visuals import LineChart
    from Spotfire.Dxp.Application.Visuals import AxisRange
    
    #To set the axis range:
    lChart = lineChart.As[LineChart]()
    newAxisRange = AxisRange(-2000, 60000)
    lChart.YAxis.IndexedRange["Sum(Col1)"] = newAxisRange
    
    #To read the manually set axis range:
    
    print lChart.YAxis.IndexedRange["Sum(Col1)"].Low
    print lChart.YAxis.IndexedRange["Sum(Col2)"].High
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...