This is a migrated thread and some comments may be shown as answers.

Get legend different than item labels

0 Answers 29 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Covertix
Top achievements
Rank 1
Covertix asked on 19 May 2014, 09:48 AM
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.       


No answers yet. Maybe you can help?

Tags
Chart (Obsolete)
Asked by
Covertix
Top achievements
Rank 1
Share this question
or