Pie Chart problems

Thread is closed for posting
7 posts, 1 answers
  1. Simon
    Simon avatar
    3 posts
    Member since:
    Mar 2008

    Posted 18 Mar 2008 Link to this post

    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

  2. Answer
    Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 20 Mar 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Simon
    Simon avatar
    3 posts
    Member since:
    Mar 2008

    Posted 20 Mar 2008 Link to this post

    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

  5. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 21 Mar 2008 Link to this post

    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
  6. Simon
    Simon avatar
    3 posts
    Member since:
    Mar 2008

    Posted 25 Mar 2008 Link to this post

    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.
  7. Zhou
    Zhou avatar
    2 posts
    Member since:
    May 2012

    Posted 02 May 2012 Link to this post

    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 
  8. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 07 May 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017