Binding in WPF Toolkit on Chart Series-Collection of common programming errors
it’s my first post here so, sorry for my mistakes in advance:). Here is my problem: I am trying to build a WPF application using the MVVM pattern and I’m not ALWAYS able to load data in my chart. The only time when it works is when I use the PieSeries. In the all other cases I receive an error. What is strange is that in my designer window is amable to see my chart. Here is my code:
In the viewModel I have among other things:
private ObservableCollection chartItems;
public MainWindowViewModel()
{
chartItems = new ObservableCollection();
chartItems.Add(new ChartElement("da011111111111", 3));
chartItems.Add(new ChartElement("adas111111", 490));
chartItems.Add(new ChartElement("adas111111", 341));
chartItems.Add(new ChartElement("adas111111", 413));
chartItems.Add(new ChartElement("adas111111", 143));
}
Image with the error
Thank you in advance.