I have the following code to add data to my pie chart in code, but I don't seem to figure out how to set the label for each slice. I looked at the docs but did not really see how to translate my Dictionary.
The Dictionary contains <label, value>. So I just want to use this in the pie chart for data binding.
Dictionary<string, int> data = DBHelper.GetTriggerStats();
int result = new int[data.Count()];
int i = 0;
foreach (KeyValuePair<string, int> pair in data)
result[i] = pair.Value;
PieSeries series = this.TriggerPieChart.Series as PieSeries;
series.ItemsSource = result;
How can I set the label for the pie chart that is in my KeyValuePair as the Key.