Get legend different than item labels

Thread is closed for posting
1 posts, 0 answers
  1. Tzach Kaufmann
    Tzach Kaufmann avatar
    95 posts
    Member since:
    Aug 2008

    Posted 19 May 2014 Link to this post

    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);



    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


    I want each part of the pie to display the number of violations, and in legend I want to see the time slot.       

Back to Top