I am using a OxyPlot to Real time changing data.
I do this using a Dispatcher Timer in a WPF C# app.
plotTimer.Interval = TimeSpan.FromMilliseconds(1000);
plotTimer.Tick += PlotTimer_Tick;
plotTimer.Start();
SensorPlotModel is a class of primarily the OxyPlot plotmodel with some properties to help keep track of which sensors it is for.
<oxy:PlotView Grid.Row="2" Grid.RowSpan="5" Grid.Column="1" Grid.ColumnSpan="4" Model="{Binding graphPlotModel}" MinHeight="250" MinWidth="1200"/>
The plotModel is then bound in this way to the xaml, where graphPlotModel is a property of the dataContext.
The graph works well when the sensor value is changing. When the value is not changing, the graph seems to be updated with the values, however, the zoom is not changing meaning that the past values can be seen but not the new ones.
I suspect Oxyplot is optimising by not zooming to the new values.
Please let me know if there a problem in the code.
FYI, the graphs are initialised as so:
DateTimeAxis dateAxis = new DateTimeAxis();
dateAxis.Position = AxisPosition.Bottom;
dateAxis.StringFormat = "mm:ss";
dateAxis.MajorGridlineStyle = LineStyle.Solid;
dateAxis.MinorGridlineStyle = LineStyle.Dot;
dateAxis.MinimumMajorStep = 1;
dateAxis.IntervalType = DateTimeIntervalType.Minutes;
//dateAxis.MaximumRange = 10;
//dateAxis.IntervalLength = 5;
plotModel.Axes.Add(dateAxis);
LinearAxis valueAxis = new LinearAxis();
valueAxis.Position = AxisPosition.Left;
valueAxis.StartPosition = 0;
valueAxis.MajorGridlineStyle = LineStyle.Solid;
valueAxis.MinorGridlineStyle = LineStyle.Dot;
valueAxis.Maximum = max;
valueAxis.Minimum = min;
plotModel.Axes.Add(valueAxis);