I have a method that creates a series in a chart and plots 1 pair of x and y coordinates, although I am unable to add more than one pair of points / coordinates:
private void button1_Click(object sender, EventArgs e)
{
// Set palette.
this.chart2.Palette = ChartColorPalette.SeaGreen;
// Set title.
this.chart2.Titles.Add("Test Chart");
// Add series and points
chart2.Series.Add("RAM").Points.AddXY(22,23);
If I try adding something like:
chart2.Points.AddXY(22,23);
I get the following message:
The type or namespace name ‘Points’ does not exist in the namespace
‘Chart2
The error tells you that Points is not a member of chart2. I think you need to try:
chart2.Series[“seriesname”].Points.AddXY(22,23).
Refer to this post for an example on how to add a series of points at once:
Adding a series of points to a chart
Edit: You need to know the seriesname which should be in your aspx page as something like this:
series[0] may also work.