Customer Banners (Ads) - SpiceUp. AX and SpotfireX Disclaimer



If you find this site useful and you want to support, buy me a coffee   to keep this site alive and without ads.

Change Axis Range

from Spotfire.Dxp.Application.Visuals import VisualContent, AxisRange

viz= viz1.As[VisualContent]()
viz.YAxis.Range = AxisRange(0,100)

2 comments:

Chuck said...

I am curious how I can have the y-axis range controlled by Property Control like a pair of Input Field (name them 'a' and 'b')? First test a=1, b=10; next test a=3, b=5. Thanks a lot!

Jose Leviaguirre said...

Hello Chuck,

If you are trying to pass parameters to the AxisRange do this:

a = Document.Properties["a"]
b = Document.Properties["b"]
viz= viz1.As[VisualContent]()
viz.YAxis.Range = AxisRange(a,b)

Make sure your document properties (driven by Input Field Property Controls) are the correct data type. For categorical data, the range is expressed as two indices. Either end can be null, indicating a default value.