Unable to programmically update points on a Chart in vb 2010
I am using vb 2010 in VS 2010 Express.
I have a Chart control which is named Chart1.
Imports System.Windows.Forms.DataVisualization.Charting
I tried to change one of the Title lines with the following code:
Chart1.titles.SpNameTitle.text = "Tom Jones"
I am getting this error on the Chart1 part of the above code: 'Chart1' is not defined. It may be inaccessable due to it's protection level.
How can that be? My chart is named Chart1?
Re: Unable to programmically update points on a Chart in vb 2010
The error doesn't sound right for my recommendation, but a chart uses a Titles collection to hold multiple titles. Try the following...
Code:
Chart1.Titles(0).text = "Tom Jones"
kevin
ps.. Tom Jones is one cool dude :cool:
RESOLVED: Unable to programmically update points on a Chart in vb 2010
I solved my own problem.
As I was stepping out of the shower, it occured to me that the chart control was corrupted. So I deleted the Chart1 control and added it back and everything is fine.
Sorry about the time waster!