Axis with fixed values on a stream

Oct 17, 2013 at 7:18 AM
Hi,

is it possible to always show the latest defined range (via minimum and maximum) on a running stream?

I do have a continous stream adding values 1,2,3,4,5sec and so on. My x-axis should only show the last second. The labels should show 0 to 1 for example.

I can do this, always cutting the last second and changing x-values from 0 to 1, but this is not satisfactory.

Any idea how to do that? A plus would be if I can also zoom.

Thanks in advance
Oct 17, 2013 at 10:13 AM
Use the AxisChanged event. Capture the ActualMaximum of your axis and then assign the Minimum in accordance. Good luck
Oct 17, 2013 at 12:27 PM
Edited Oct 17, 2013 at 12:40 PM
Thanks everytimer for your quick response. But how to use the AxisChanged event? This does only fire if I zoom or pan not if the values increase.

I simply added the event like so:
var timeAxis = new LinearAxis(AxisPosition.Bottom, 0) { MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot, Title = "Time", Unit="s" };
PlotModel.Axes.Add(timeAxis);
timeAxis.AxisChanged +=timeAxis_AxisChanged;
So there is no min/max defined and the axis increases its values as needed.

I would like to get a (oscilloscope like) behaviour like this. That the X axis is fixed to a small window of 5 seconds of the newest data, here is an example:
Image