Pie chart legend location

2 posts, 0 answers
  1. Josh
    Josh avatar
    1 posts
    Member since:
    May 2016

    Posted 17 May 2016 Link to this post


    I'm trying to create a winform with a few different charts. I'm starting with the pie chart and having a couple issues.

    1) I want to have the legend on the left hand side. Under ChartElement, I can see the LegendPosition and have set that to "Left" and in design time I can see it on the left. However, when I run the app it moves back over to the right side.

    2) I also want to move legend closer to the pie chart. I found under ChartElement, LegendElement, PositionOffset, I can set that to 100 and it moves it closer, however because of problem 1 above it moves it off the form durning run time (it looks fine at design time).

    3) It's displaying the values as percent (%), but in this case I want a hard number. How can I remove/change it from percent base?

    Attached is a screen showing how I would like the final look.


  2. Dess
    Dess avatar
    2107 posts

    Posted 18 May 2016 Link to this post

    Hello Josh,

    Thank you for writing.

    When I set the ChartElement.LegendPosition property to LegendPosition.Left, it is displayed as expected on my end. The ChartElement.LegendElement.PositionOffset property is also respected. I have attached my sample project. Could you please specify the exact steps how to reproduce the problem so I can investigate the precise case? Thank you in advance. 

    As to the percentage value, note that each PieDataPoint is visualized as a pie slice with arc size directly proportional to the magnitude of the raw data point’s value. That is why the value is represented as a percentage of the whole part. The LabelFormatting event is appropriate for customizing the series labels:
    private PieDataPoint pieDataPoint;
    private PiePointElement piePointElement;
    private void radChartView1_LabelFormatting(object sender, ChartViewLabelFormattingEventArgs e)
        pieDataPoint = e.LabelElement.DataPoint as PieDataPoint;
        if (pieDataPoint != null)
            e.LabelElement.Text = "Value: " + string.Format("{0:###,##0.00}", pieDataPoint.Value);

    I hope this information helps. Should you have further questions I would be glad to help.

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top