Hello,
I've inserted a pie chart inside my report and it does a sum of some percentage....with other reporting tool I was able to set at 0-cost the legend to match the seriesitem portion of the pie... here I'm not able to.. here's the code I use:
I've got only a legend Item called "Series XX"... in other chart type (BAR for example) I add different Series and it show...here not...any suggestion?
I've also found this enumerator, but I don't know where to set it : ChartSeriesLegendDisplayMode.ItemLabels;
Thanks
I've inserted a pie chart inside my report and it does a sum of some percentage....with other reporting tool I was able to set at 0-cost the legend to match the seriesitem portion of the pie... here I'm not able to.. here's the code I use:
private void chart1_NeedDataSource(object sender, EventArgs e) |
{ |
Telerik.Reporting.Processing.Chart procChart = (Telerik.Reporting.Processing.Chart)sender; |
List<AccountPositionDetail> accountPositionDetailList = GetAccountPositionDetailFromDataSet(this.DataSource as DataSet); |
ChartSeries cs = new ChartSeries(); |
cs.Type = ChartSeriesType.Pie; |
var groupedAccountPosition = accountPositionDetailList.GroupBy(o1 => o1.ClassMifid); |
chart1.Legend.Clear(); |
foreach (IGrouping<int, AccountPositionDetail> igp in groupedAccountPosition) |
{ |
ChartSeriesItem csi = new ChartSeriesItem(igp.Sum(o1 => o1.PercOnCTV)); |
cs.Items.Add(csi); |
} |
chart1.Series.Add(cs); |
} |
I've got only a legend Item called "Series XX"... in other chart type (BAR for example) I add different Series and it show...here not...any suggestion?
I've also found this enumerator, but I don't know where to set it : ChartSeriesLegendDisplayMode.ItemLabels;
Thanks