PieChart series are not centered on iOS

2 posts, 0 answers
  1. Alexei
    Alexei avatar
    2 posts
    Member since:
    Sep 2016

    Posted 02 Sep 2016 Link to this post

    Hi Telerik team!

    Trying to display a simple chart. It works fine in Android, but in iOS it looks like series are not centered. (screen attached)

    Could you please help with it?

    <telerikChart:RadPieChart Palette="{x:Static viewModels:BenefitsViewModel.CustomChartPalette}" BackgroundColor="Aqua"
                                                        RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.5, Constant=-100}"
                                                        RelativeLayout.YConstraint="{ConstraintExpression Type=Constant, Constant=50}"
                                                        RelativeLayout.WidthConstraint="{ConstraintExpression Type=Constant, Constant=200}"
                                                        RelativeLayout.HeightConstraint="{ConstraintExpression Type=Constant, Constant=200}" Rotation="90">
                                                    <telerikChart:PieSeries ItemsSource="{Binding PieChartBenefitsData}" AllowSelect="False" ShowLabels="False" >
                                                        <telerikChart:PropertyNameDataPointBinding PropertyName="Value"/>

  2. Tsvyatko
    Tsvyatko avatar
    863 posts

    Posted 06 Sep 2016 Link to this post

    Hello Alexei,

    I can confirm the issue from our side. We will address it in our next official release (due in the mid September).

    Meanwhile I can suggest the following workaround:

     - define custom renderer in ios project:
    public class CustomChartRenderer : PieChartRenderer
           protected override void OnElementChanged(ElementChangedEventArgs<RadPieChart> e)
               this.Control.Insets = new UIKit.UIEdgeInsets(10, 10, 10, 10);

    - Set it as renderer for the pie chart:
    [assembly: Xamarin.Forms.ExportRenderer(typeof(Telerik.XamarinForms.Chart.RadPieChart), typeof(CustomChartRenderer))]

    Please excuse us for the inconvenience caused.

    Telerik by Progress
    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