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

Chart data labels and legend

3 Answers 347 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alexander Shashkin
Top achievements
Rank 1
Alexander Shashkin asked on 01 Sep 2011, 07:17 PM
I'm trying to create test report with chart and here what I have:
this.chart3.BitmapResolution = 96F;
this.chart3.ChartTitle.Appearance.Visible = false;
this.chart3.ChartTitle.Visible = false;
this.chart3.DataSource = this.sqlDataSource2;
this.chart3.DefaultType = Telerik.Reporting.Charting.ChartSeriesType.Pie;
this.chart3.ImageFormat = System.Drawing.Imaging.ImageFormat.Emf;
this.chart3.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(7.800079345703125D, Telerik.Reporting.Drawing.UnitType.Inch));
this.chart3.Name = "chart3";
chartMargins5.Bottom = new Telerik.Reporting.Charting.Styles.Unit(1D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
chartMargins5.Left = new Telerik.Reporting.Charting.Styles.Unit(1D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
chartMargins5.Right = new Telerik.Reporting.Charting.Styles.Unit(24D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
chartMargins5.Top = new Telerik.Reporting.Charting.Styles.Unit(1D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
this.chart3.PlotArea.Appearance.Dimensions.Margins = chartMargins5;
this.chart3.PlotArea.XAxis.MinValue = 1D;
chartSeries1.Appearance.LegendDisplayMode = Telerik.Reporting.Charting.ChartSeriesLegendDisplayMode.ItemLabels;
chartSeries1.Appearance.ShowLabelConnectors = true;
chartSeries1.DataLabelsColumn = "Department";
chartSeries1.DataYColumn = "TotalJobs";
chartSeries1.Name = "Jobs";
chartSeries1.Type = Telerik.Reporting.Charting.ChartSeriesType.Pie;
this.chart3.Series.AddRange(new Telerik.Reporting.Charting.ChartSeries[] {
chartSeries1});
this.chart3.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(5.7999601364135742D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(2.8998820781707764D, Telerik.Reporting.Drawing.UnitType.Inch));
Result attached in TelerikReports-chart file.

My questions:
1) How I can fix data labels? Right now some of them overlay other. See "Human Resources" and "Healthcare" at the bottom of img.
2) I want to display numbers in data labels and text in legend. For example "Sales/Marketing" should be replaced to 60, but legend should be the same.

Thanks

3 Answers, 1 is accepted

Sort by
0
Alexander Shashkin
Top achievements
Rank 1
answered on 01 Sep 2011, 07:53 PM
I resolved my second issue with tip from http://www.telerik.com/community/forums/reporting/telerik-reporting/pie-chart-legend-is-showing-item1-2.aspx, but I think that should be another way to solve it and continue use DataSource. If no then may be I should create feature request or something else?

About first issue:
I have similar problem with StackedBar. You can find screeenshot in TelerikReports-StackedBar. I need advice how I can fix issue with data labels for small bars.
0
Alexander Shashkin
Top achievements
Rank 1
answered on 01 Sep 2011, 08:51 PM
I found how I can solve 1 issue: I set IntelligentLabelsEnabled to true. some times I need to set AutoLayout=true too.
Of course some times it draws labels in very strange manner, but they are not overlapped.
0
Chavdar
Telerik team
answered on 06 Sep 2011, 05:14 PM
Hi Alexander Shashkin,

Your both solutions are correct. At the moment there is no other way to accomplish this functionality.

Kind regards,
Chavdar
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
General Discussions
Asked by
Alexander Shashkin
Top achievements
Rank 1
Answers by
Alexander Shashkin
Top achievements
Rank 1
Chavdar
Telerik team
Share this question
or