RadChart1.SeriesMappings.Clear();
SeriesMapping mapping = new SeriesMapping();
mapping.SeriesDefinition = new Pie3DSeriesDefinition();
ItemMapping item = new ItemMapping();
item.DataPointMember = DataPointMember.YValue;
item.FieldName = "RedemptionCount";
mapping.LegendLabel = "Redemptions";
mapping.ItemMappings.Add(item);
mapping.SeriesDefinition.LegendDisplayMode = LegendDisplayMode.DataPointLabel;
RadChart1.SeriesMappings.Add(mapping);
RadChart1.ItemsSource = e.Result;
RadChart1.DefaultView.ChartTitle.Content = "Redemptions";
The Pie correctly displays Redemptions and the legend lists the corresponding items, but it only says Item 0, Item 1, Item 2. Each of these items represent a specific Program and should be labeled accordingly. I am able to obtain the Program Title by doing: e.Result[1].ProgramTitle.ToString(). Doing it this way I need to provide the index of the result to get the program title, so I would be needing a foreach loop to rename each of the existing legend items.
Also, in the Pie Chart the RedemptionCount is displayed next to the slice of the Pie it corresponds to. if it is possible, can I set the Program Title to display alongside the RedemptionCount in the chart and forego the Legend completely?
On a side note, the colors in the Pie Chart and the Legend (which the controls are autogenerating) do not quite match. Yellow is being used in the Pie and matches closest to the Orange in the Legend. There is a light blue in the pie that matches to a darker blue in the legend and the green is more flourescent in the legend. Is there any reason for this?
Let me know of the best way to assign the values for the Legend labels/names.
Thanks.