如何使用 IronPython 在 Spotfire 中的条形图上设置 x 轴 (xaxis)?

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

我需要更改条形图上 x 轴上使用的列。 我如何在 IronPython 中执行此操作?

改变 x 轴上的内容?

#change the Range from 0 to 100:
from Spotfire.Dxp.Application.Visuals import VisualContent, AxisRange
viz= viz1.As[VisualContent]()
viz.XAxis.Range = AxisRange(0,100);

有关更多属性,请参阅 API

这是我的做法。

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