1

I am trying to get one point of a Chart in C# Visual Studio 2010 using the following code:

chart1.Series[0].Points.Item[1]

but I get the following error:

Error 1 'System.Windows.Forms.DataVisualization.Charting.DataPointCollection' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'System.Windows.Forms.DataVisualization.Charting.DataPointCollection' could be found (are you missing a using directive or an assembly reference?)

But supposedly Points being a DataPointCollection should have the property Item as is shown on Microsoft's webpage:

http://msdn.microsoft.com/en-us/library/system.windows.forms.datavisualization.charting.datapointcollection.aspx

What am I doing wrong?

deiviz
  • 45
  • 1
  • 6

1 Answers1

1

Surely, since Points is the collection, you should be doing:

chart1.Series[0].Points[1].Item
Gareth
  • 2,746
  • 4
  • 30
  • 44
  • 1
    actually I fixed it with: `chart1.Series[0].Points[1].YValues` as I can't get it to recognize the `Item` – deiviz Oct 19 '13 at 22:40