Search code examples
ironpythonspotfire

How do I set the x-axis (xaxis) on a Bar Graph in Spotfire with IronPython?


I need to change the column used on the x-Axis on a bar chart. how can I do this in IronPython?


Solution

  • Here's how I do it.

    from Spotfire.Dxp.Application.Visuals import VisualContent
    
    #"visual" is the name of the parameter found in the "Script Parameter" dialog below the editor which points to the visualization I want to change.
    vc = visual.As[VisualContent]()
    exp="["+Document.Properties["DocPropertyNameHere"]+"]"
    vc.YAxis.Expression =exp