Reputation: 55
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:
What am I doing wrong?
Upvotes: 1
Views: 677
Reputation: 2791
Surely, since Points is the collection, you should be doing:
chart1.Series[0].Points[1].Item
Upvotes: 1