I am trying to add a List to a chart. This list contains a 2 and a 4.
foreach (decimal D in numbers)
{
barChart.Series[0].Points.AddXY(1, D);
}
It needs to add D to index 1 on the X axis. However, this only outputs 4 rather than six at X1. When it gets to the 4 in the list, it overwrites the 2 that is there, rather than adding to it (making 6). How do I make it add rather than overwrite?
EDIT: I did not give enough information apparently. I am using Windows Forms. The chart I am using is in the Data section of Visual Studio 2015.