You can attach an event handler for the XAxisRangeChanged and/or YAxisRangeChanged event on the WaveformGraph. Panning the graph updates the range of the axis causing a range event to be raised. In the event handler, you can check if the maximum of the axis range is greater than the maximum of your data. If so, you can set the maximum of the axis range to the maximum data value. The implementation would be similar for the minimum value. Here is an example that restricts the range of the x-axis by attaching an event handler to the XAxisRangeChanged event:
// e represent the event argument of the
// XAxisRangeChanged event.
XAxis xAxis = e.XAxis;
double delta = xAxis.Range.Maximum - xAxis.Range.Minimu
m;
// These values should be changed to the
// actual minimum and maximum value of
// the data.
double dataMaximum = 20;
double dataMinimum = -10;
if (xAxis.Range.Maximum > dataMaximum)
{
xAxis.Range = new Range(dataMaximum - delta, dataMaximum);
}
else if (xAxis.Range.Minimum < dataMinimum)
{
xAxis.Range = new Range(dataMinimum, dataMinimum + delta);
}
Hope that helps.
Abhishek Ghuwalewala
Measurement Studio