private void AddPoint(CurveItem curve,double x, double y) { if (x < _minXValue) { _minXValue = x; } if (x > _maxXValue) { _maxXValue = x; } if (y < _minYValue) { _minYValue = y; } if (y > _maxYValue) { _maxYValue = y; } curve.AddPoint(x, y); }
/// <summary> /// copy data from TimeSeries.Series into ZedGraph CurveItem /// </summary> /// <param name="s"></param> /// <param name="tSeries"></param> void FillTimeSeries(Series s,CurveItem tSeries) { if (s.Count == 0) { return; } pane.XAxis.Type = AxisType.Date; int sz = s.Count; for (int i = 0; i < sz; i++) { Point pt = s[i]; double x = pt.DateTime.ToOADate(); if (!pt.IsMissing) { tSeries.AddPoint(x, pt.Value); } else { tSeries.AddPoint(x, Double.NaN); } } }