I want to bind a data table that contains a list of budgets (name & value column).
<v:Chart x:Name="BudgetChart"
Title="Budget Distribution">
<v:PieSeries x:Name="PieSeries"
IndependentValueBinding="{Binding Path=CategoryName}"
DependentValueBinding="{Binding Path=Value}"/>
</v:Chart>
I bind my data to the chart like this, and it works fine the first time.
void RefreshChart()
{
PieSeries.ItemsSource = dataTable;
}
My problem, is that if I call RefreshChart() a second time, I get the following exception:
KeyNotFoundException: The given key was not present in the dictionary.
Is there something I'm not doing right?