title: Set Spotfire Graph Axis Range Programatically
body: <p>I am trying to program a simple IronPython script to set the date range of my line graph x-axis in Spotfire based on property control user inputs.  I cannot find any documentation or examples of this, so here's what I guessed, but it's not working:</p>
  
  <pre><code>from Spotfire.Dxp.Application.Visuals import LineChart
  from Spotfire.Dxp.Application.Visuals import ScaleAxis
  
  plot1= plot1.As[LineChart]()
  plot1.XAxis.Min = StartDate
  plot1.XAxis.Max = EndDate
  </code></pre>
  
  <p>I entered the visualization and the property control as Script Parameters in the Edit Script window.  Does anyone know how to make this work??  Thanks!</p>
  
  <p>Note: I do not want to use zoom sliders.</p>
  
  <hr>
  
  <p>Update: I am doing a Sum([Column]) OVER (AllPrevious([Date])) so I can't filter any dates out for the calculation of Y.  I just need them filtered out of the X axis range.  The original table is structured like this:
  | Product | Date | Phase |</p>
  
  <p>And I have calculated columns for each of the phases with formulas:
  If([Phase]="Phase A",1,0)</p>
  
  <p>Essentially the graph shows how many products have gone through each stage of production over time, so I need to always know the completion date of each phase to count the number of products in that phase on any particular date.  I only want to see a certain date range on the X-axis though because I have some other graphs placed above/below from 2 other tables to compare sales and costs, and it's easier to analyze based on the number of products in each phase when the axes show the same dates.  Sorry I can't upload pictures so I hope that makes sense.</p>
  
  <p>We only care about the most recent sales/costs, and I restrict those dates with the filters using Data on Demand for the sales and costs tables so the graphs automatically show what I want.  Now the only issue is filtering the range for the # of Products graph because the dates in the phase columns can go back years, and we need to know how many total products are in each phase, but we don't want to see the graph from the beginning of time...I can achieve this with a zoom slider or hardcoding the min/max in that graph, but I was really hoping for something automated so we don't have to continually adjust it.</p>