I found a weird behavior in MS Chart for Windows Forms.
Let's say I want to have a scatter plot with two points (1,10) and (1,20). I can do that in this way:
....
Series series = new Series();
series.ChartType = SeriesChartType.Point;
double[] x = { 1, 1 };
double[] y = { 10, 20 };
series.Points.DataBindXY(x, y);
That works fine. But now I want the same result, but both x-values should be 0
.
double[] x = { 0, 0 };
double[] y = { 10, 20 };
series.Points.DataBindXY(x, y);
In that case the chart control creates two data points at 'autogenerated' x positions 1 and 2. It just ignores the given x-values. It is the same behavior if I use
series.Points.AddXY(0, 10);
series.Points.AddXY(0, 20);
I get the same effect for more than two data points. So it turns out that scatter plot does not work if not at least one x-value is nonzero.
I think a possible workaround would be to use multiple series, but that is inacceptable.
Does anyone have a explanation for this behavior or a solution for this problem?