Position of data points on Xamarin Forms UWP Pie Chart

2 posts, 0 answers
  1. Ram Prasad
    Ram Prasad avatar
    6 posts
    Member since:
    Mar 2017

    Posted 11 Jul Link to this post

    Hello,

    Is there any way to change position of data points (numbers) on Xamarin Forms UWP/Windows Pie Chart, currently they render out side of Pie Chart, and get clipped.

    Thanks,

    Ram prasad

     

  2. Nasko
    Admin
    Nasko avatar
    692 posts

    Posted 14 Jul Link to this post

    Hi Ram,

    By default UWP's native RadPieChart clips its content to restrict the elements to render outside its rectangle. So, what we could suggest you for you scenario is set the ClipToBounds property of the native Chart to False. That you could achieve by creating a custom PieChartRenderer for UWP and inside the UpdateNativeControl method set the mentioned above property:
    [assembly: ExportRenderer(typeof(Telerik.XamarinForms.Chart.RadPieChart), typeof(CustomPieChartRenderer))]
    namespace RadChartXF_1118682.UWP
    {
        public class CustomPieChartRenderer : PieChartRenderer
        {
            protected override void UpdateNativeControl()
            {
                base.UpdateNativeControl();
                if (this.Control != null)
                {
                    this.Control.ClipToBounds = false;
                }
            }
        }
    }

    Hope this helps.

    Regards,
    Nasko
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top