PieChart legend not showing the name

5 posts, 1 answers
  1. Vincent
    Vincent avatar
    9 posts
    Member since:
    Sep 2014

    Posted 03 Mar 2015 Link to this post

    As you can see in my screen capture, the name is not showing in the legend of the pie chart.

        Here is the code : 

    setup.NomSetup contain the string name
    var serie = new PieSeries()
     {
         ShowLabels = true,
         RadiusFactor = 0.9f,
         Range = new Telerik.Charting.AngleRange(270, 360)
     };
     
      
     foreach(var setup in setups){
         serie.DataPoints.Add(new PieDataPoint(Convert.ToDouble(setup.SommeUseTime * 100 / timeclocks.First().SommeTempsStd), setup.nomsetup)
         {
             Name = "Test"
         });
     }
     
    pieChart.Series.Clear();
     
    pieChart.Series.Add(serie);
    pieChart.ShowLegend = true;
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 04 Mar 2015 Link to this post

    Hi Vincent,

    Thank you for writing.

    I have used the following code with our latest version and the labels are shown as expected on my end.
    RadChartView pieChart = new RadChartView();
    this.Controls.Add(pieChart);
     
    var serie = new PieSeries()
    {
        ShowLabels = true,
        RadiusFactor = 0.9f,
        Range = new Telerik.Charting.AngleRange(270, 360)
    };
     
     
    for (int i = 0; i < 5; i++)
    {
        serie.DataPoints.Add(new PieDataPoint(Math.PI * i, "Slice " + i)
        {
            Name = "Test"
        });
    }
     
    pieChart.Series.Clear();
    pieChart.AreaType = ChartAreaType.Pie;
    pieChart.Series.Add(serie);
    pieChart.ShowLegend = true;

    You can see the result in the attached image. 

    Since the code is pretty much the same, my guess is that the setup.nomsetup variable does not return a non-empty string. Can you please check that?

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Vincent
    Vincent avatar
    9 posts
    Member since:
    Sep 2014

    Posted 04 Mar 2015 in reply to Stefan Link to this post

    Hi, 

    This is the chart I get if I use your part of the following code :

    int i = 0;
    foreach(var setup in setups){
        i++;
        serie.DataPoints.Add(new PieDataPoint(Math.PI * i, "Slice " + i)
        {
            Name = "Test"
        });
    }

    Please see the attached files... it's still not working.
  5. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 06 Mar 2015 Link to this post

    Hi Vincent,

    Thank you for the clarification.

    We had an issue causing this behavior, and this issue is already resolved in our latest version. I have tested with it, hence I did not observe the same behavior as you. Feel free to upgrade to our latest version in order to benefit from the fix.

    If you are unable to upgrade, on the issue page we do have a workaround provided: http://feedback.telerik.com/Project/154/Feedback/Details/121076-fix-radchartview-pieseries-do-not-show-the-legend-properly-the-values-are-not.

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Vincent
    Vincent avatar
    9 posts
    Member since:
    Sep 2014

    Posted 09 Mar 2015 in reply to Stefan Link to this post

    The update did the fix, thanks for the support!
Back to Top
UI for WinForms is Visual Studio 2017 Ready