When GraphPane contains only one CurveItem rime series, everything works fine, each new point is added to the chart and displayed without gaps or missing values.
Then, I add second time series to the same GraphPane and data points in these time series come in with different frequencies, so they have different values on X axis, data type of X axis is set to DateAsOrdinal. At this moment, when I add data points to each time series, chart seems to try to synchronize data points in both time series and populate difference between data point in the first time series and data point in the second with some average intermediate values.
Example
var seriesA = new PointPairList();
var seriesB = new PointPairList();
var valuesA = new []
{
new PointPair { DateTime.Parse("2006-01-01", 5) },
new PointPair { DateTime.Parse("2006-01-02", 25) },
new PointPair { DateTime.Parse("2006-01-03", 15) },
new PointPair { DateTime.Parse("2006-01-04", 0) },
new PointPair { DateTime.Parse("2006-01-05", 10) }
};
for (var i = 0; i < 5; i++)
{
control.GraphPane.seriesA.Add(valuesA[i]);
}
// Until now, everything works fine, now I try to add one point to the second seriesB
control.GraphPane.seriesB.Add(new PointPair { DateTime.Parse("2006-02-05", 10) });
// At this moment, chart identifies that the average interval between dates is 1 day
// and try to populate missing spaces between seriesA (2006-01-05) and seriesB (2006-02-05)
// and automatically adds 30 more points to seriesA and 34 points to seriesB to make them equal
At the end I expect seriesA to have 5 points and seriesB 1 point, but ZedGraph tries to enforce equal number of data points, which is 35.
Question
How to make sure that I see on the chart only points that I added myself?
Chart Settings
control.AutoScroll = true;
control.IsEnableHPan = true;
control.IsEnableVPan = true;
control.IsEnableHZoom = false;
control.IsEnableVZoom = false;
control.IsShowHScrollBar = false;
control.IsShowVScrollBar = false;
control.IsAutoScrollRange = true;
control.IsShowPointValues = true;
control.IsSynchronizeXAxes = true;
control.IsEnableWheelZoom = false;
control.IsZoomOnMouseCenter = false;
Pane Settings
area.XAxis.Title.Text = string.Empty;
area.XAxis.Type = AxisType.DateAsOrdinal;
area.XAxis.Scale.Format = "dd-MM-yyyy HH:mm";
area.XAxis.MajorGrid.IsVisible = true;
area.XAxis.Scale.MinAuto = false;
area.XAxis.Scale.MaxAuto = false;
area.YAxis.Title.Text = string.Empty;
area.YAxis.MajorGrid.IsVisible = true;
area.YAxis.Scale.MinAuto = true;
area.YAxis.Scale.MaxAuto = true;
Following code, as for me, produce correct graphs with your data.
resulting plot