Control XY Axis zoom scale

  1. Create a document property called 'mySlider' as integer type
  2. Add a text area and add a Property Control and link it to 'mySlider' to it.
  3. Use the script button on the slider widget if available. Otherwise use an Action Control to triger the script once happy with the slider value selection.

from Spotfire.Dxp.Application.Visuals import AxisRange
from Spotfire.Dxp.Application.Visuals import BarChart
from Spotfire.Dxp.Data import DataPropertyClass

#get a reference to your viz script parameter

myChart = MyChart = vis.As[BarChart]()

#read min,max from document properties

min = 0max = Document.Properties["mySlider"].Value
#max = Document.Data.Properties.GetProperty(DataPropertyClass.Document, "mySlider").Value

#apply zoom range

MyChart.YAxis.ManualZoom = True
MyChart.YAxis.ZoomRange = AxisRange(min,max);
Previous
Next Post »