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

Pie Chart problems

6 Answers 215 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 18 Mar 2008, 04:07 PM
Hi,

I'm building a pie chart with 10 slices programmatically and having a few problems getting the labels to show the way I want.

I have to set "chart.IntelligentLabelsEnabled = true;" otherwise the labels collide with each other.

But when I turn this on, some of the labels are just omitted altogether, which isn't acceptable.

Also I can't get label connectors to work at all.

I have set "series.Appearance.LabelAppearance.LabelConnectorStyle.Visible = true;" on the chart series, and also tried setting the equivalent property on the individual items for each pie slice as well. I also tried setting the .PenStyle & .Color properties explicitly.

Am I missing something?

Thanks,
Simon

6 Answers, 1 is accepted

Sort by
0
Accepted
Pavel
Telerik team
answered on 20 Mar 2008, 01:22 PM
Hello Simon,

You can solve the problem with the omitted labels in two ways:
  • Either increase the PlotArea by decreasing the margins like this: radChart.PlotArea.Appearance.Dimensions.Margins.Left = 20;
  • Or increase the distance of the label: chartSeries.Appearance.LabelAppearance.Distance = 30;.
The values set in the examples might not be the right for your case but after a bit of experimenting I think you can make it work.

As for the label connectors you should set the ShowLabelConectors property to "true". It could be useful to ensure the color of the connectors is different from the background. See the following code for reference:

chartSeries.Appearance.ShowLabelConnectors = true
chartSeries.Appearance.LabelAppearance.LabelConnectorStyle.Color = System.Drawing.Color.White; 

Hope this helps.

Regards,
Pavel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Simon
Top achievements
Rank 1
answered on 20 Mar 2008, 03:12 PM

Thanks.

I had figured out that the labels not appearing could be corrected by making the plot area a bit bigger, but hadn't seen the distance setting.

chartSeries.Appearance.ShowLabelConnectors = true;

did the trick for making the label connectors visible. Although I have no idea what LabelConnectorStyle.Visible = true is for?

- Simon

0
Pavel
Telerik team
answered on 21 Mar 2008, 02:52 PM
Hello Simon,

The LabelConnectorStyle.Visible property is "true" by default. In order to show the LabelConnectors you should set series.Appearance.ShowLabelConnectors to "true" as well. Then you can hide individual label connectors with the LabelConnectorStyle.Visible property (by setting it to false for the respective label).

I hope this explanation is clear enough.

Greetings,
Pavel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Simon
Top achievements
Rank 1
answered on 25 Mar 2008, 10:59 AM
OK, thanks.

The product seems to work very well, but to be frank I think it would be really helpful to put a bit more resource into the documentation - Just a line or two cross-referencing the entries for .ShowLabelConnectors and LabelConnectorStyle.Visible and providing some sort of context for example would be hugely helpful.

Thanks.
0
Zhou
Top achievements
Rank 1
answered on 02 May 2012, 03:17 PM
HI,Pavel  
Hi,I also have the problem!

I'm building a pie chart with 27 Series programmatically and having a few problems getting the labels to show the way I want.

            ChartSeries s = new ChartSeries();
            s.Type = ChartSeriesType.Pie;
            s.DefaultLabelValue = "#Y, (#%{#0.##%})";
            s.Appearance.ShowLabelConnectors = true;             
            s.Appearance.StartAngle = 30;             
            s.Appearance.LabelAppearance.Distance  = 60;
     otherwise the labels collide with each other.
some value is very samll,so the labels collide with each other . which isn't acceptable.
Also I can't get label connectors to work at all.
Am I missing something?

Thanks,
kany 
0
Peshito
Telerik team
answered on 07 May 2012, 09:34 AM
Hi Kany,

Please take a look at the following forum thread where my colleague Steve have already replied to you:
http://www.telerik.com/community/forums/reporting/telerik-reporting/pie-chart---connect-labels.aspx

All the best,
Peshito
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Chart (Obsolete)
Asked by
Simon
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Simon
Top achievements
Rank 1
Zhou
Top achievements
Rank 1
Peshito
Telerik team
Share this question
or