C# MSCHART data not plotted correctly on same x-axis

22 Views Asked by At

Consider the following where the x value is all 0:

Series series = chart_RawData_IVCurve.Series.Add("Total Income");
series.MarkerStyle = MarkerStyle.Circle;
series.ChartType = SeriesChartType.Line;
series.Points.AddXY(0, 10);
series.Points.AddXY(0, 20);
series.Points.AddXY(0, 30);
series.Points.AddXY(0, 40);

The chart rendered wrongly with data plotted as below: enter image description here

Strangely if I change the code like below, the chart plotted correctly as intended:

Series series = chart_RawData_IVCurve.Series.Add("Total Income");
series.MarkerStyle = MarkerStyle.Circle;
series.ChartType = SeriesChartType.Line;
series.Points.AddXY(0, 10);
series.Points.AddXY(0, 20);
series.Points.AddXY(0, 30);
series.Points.AddXY(1, 40);

enter image description here

This happens when all x-axis value = 0, the chart is not plotted correctly. Is there something I am missing?

Thanks

0

There are 0 best solutions below