I use telerik pie chart and I create it on server (from DB):
private void cViolationsPerTime_NeedDataSource(object sender, EventArgs e)
{
Telerik.Reporting.Processing.Chart procChart = (Telerik.Reporting.Processing.Chart)sender;
procChart.DataSource = BLL.BO.Audit.ExecuteAuditCommand(GenerateViolationsPerTimeSql(filters, "All"), type, conn, fromDate, toDate);
Telerik.Reporting.Charting.ChartSeries csViolationsPerTime = new Telerik.Reporting.Charting.ChartSeries();
csViolationsPerTime.DataYColumn = "NumOfViolations";
csViolationsPerTime.Type = Telerik.Reporting.Charting.ChartSeriesType.Pie;
csViolationsPerTime.DataLabelsColumn = "timeslot";
csViolationsPerTime.Appearance.LegendDisplayMode = Telerik.Reporting.Charting.ChartSeriesLegendDisplayMode.ItemLabels;
csViolationsPerTime.Appearance.ShowLabelConnectors = true;
csViolationsPerTime.Appearance.TextAppearance.TextProperties.Font = new System.Drawing.Font("Calibri", 7F);
cViolationsPerTime.Series.Clear();
cViolationsPerTime.Series.Add(csViolationsPerTime);
}
Attached screen shot with the result I get.
I want to get different legend then the data labels.
How can I bind a different column to the legend?
This is my SQL result:
timeslot numOfViolations
10:00-12:00 40
12:00-14:00 10
14:00-16:00 8
etc...
I want each part of the pie to display the number of violations, and in legend I want to see the time slot.
private void cViolationsPerTime_NeedDataSource(object sender, EventArgs e)
{
Telerik.Reporting.Processing.Chart procChart = (Telerik.Reporting.Processing.Chart)sender;
procChart.DataSource = BLL.BO.Audit.ExecuteAuditCommand(GenerateViolationsPerTimeSql(filters, "All"), type, conn, fromDate, toDate);
Telerik.Reporting.Charting.ChartSeries csViolationsPerTime = new Telerik.Reporting.Charting.ChartSeries();
csViolationsPerTime.DataYColumn = "NumOfViolations";
csViolationsPerTime.Type = Telerik.Reporting.Charting.ChartSeriesType.Pie;
csViolationsPerTime.DataLabelsColumn = "timeslot";
csViolationsPerTime.Appearance.LegendDisplayMode = Telerik.Reporting.Charting.ChartSeriesLegendDisplayMode.ItemLabels;
csViolationsPerTime.Appearance.ShowLabelConnectors = true;
csViolationsPerTime.Appearance.TextAppearance.TextProperties.Font = new System.Drawing.Font("Calibri", 7F);
cViolationsPerTime.Series.Clear();
cViolationsPerTime.Series.Add(csViolationsPerTime);
}
Attached screen shot with the result I get.
I want to get different legend then the data labels.
How can I bind a different column to the legend?
This is my SQL result:
timeslot numOfViolations
10:00-12:00 40
12:00-14:00 10
14:00-16:00 8
etc...
I want each part of the pie to display the number of violations, and in legend I want to see the time slot.