Hi,
I'm new to Silverlight development and am currently venturing into the Charting territory. I've been following several tutorials that show how easy it is to bind a ColumnSeries to a datasource using ItemsSource (http://silverlight.net/forums/t/44166.aspx).
I'm programatically adding a chart to a canvas.
Chart BudgetChart = new Chart { Title = "budget", MaxHeight= 200, MaxWidth=500};
ColumnSeries cs = new ColumnSeries();
BudgetChart.Series.Add(cs);
cs.Title = "blarg";
cs.ItemsSource = o.Budget; //returns List<Budget>
cs.IndependentValueBinding = new System.Windows.Data.Binding("Budget");
cs.DependentValueBinding = new System.Windows.Data.Binding("Year");
This code compiles fine. However, when I debug it, this error is throw However, I've been experiencing a lot of difficulty with ItemsSource. Each time I assign the ItemsSource, I get a error stating that it's Sys.InvalidOperationException: ManagedRuntimeError error #4004 in control 'Xaml1': System.NullReferenceException System.NullReferenceException: Object not set to an instance of an object. at System.Windows.Control.DataVisualization.Charting.ColumnSeries.<>c__DisplayClass8.b__4()
Please help, this error is driving me crazy!!!