We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

requestLayout() improperly called by com.syncfusion.charts.ChartRootLayout

Thread ID:

Created:

Updated:

Platform:

Replies:

124631 Jun 20,2016 06:33 AM UTC Jun 21,2016 05:36 AM UTC Xamarin.Forms 2
loading
Tags: SfChart
Michal
Asked On June 20, 2016 06:33 AM UTC

Hello,

Im just starting out with forms, created a simple forms plc project

(VisualStudio 2015)
I have added nuget reference to http://nuget.syncfusion.com/xamarin

Then throught nuget manager added the reference: Syncfusion.xamarn.sfchart

The I made a simple page to test the charts, code below

But nothing is appearing, im getting an error:
06-20 13:29:30.532 W/View    ( 4391): requestLayout() improperly called by com.syncfusion.charts.ChartRootLayout{acfb4af8 V.E..... ......ID 20,20-1815,1130 #7f0b0064 app:id/rootLayout} during layout: running second layout pass

Could someone help me figure this out.

********************************************************************************
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:xForms="clr-namespace:Syncfusion.SfChart.XForms;assembly=Syncfusion.SfChart.XForms"
             x:Class="ChartsTest.Page1"

  <xForms:SfChart>
    <xForms:SfChart.Series>
      <xForms:ColumnSeries ItemsSource = "{Binding HighTemperature}"/>
    </xForms:SfChart.Series>
</xForms:SfChart>
</ContentPage>


********************************************************************************
public partial class Page1 : ContentPage
    {
        public ObservableCollection<ChartDataPoint> HighTemperature { get; set; }
        public Page1()
        {
            HighTemperature = new ObservableCollection<ChartDataPoint>();
            HighTemperature.Add(new ChartDataPoint("Jan", 42));
            HighTemperature.Add(new ChartDataPoint("Feb", 44));
            HighTemperature.Add(new ChartDataPoint("Mar", 53));
            HighTemperature.Add(new ChartDataPoint("Apr", 64));
            HighTemperature.Add(new ChartDataPoint("May", 75));
            HighTemperature.Add(new ChartDataPoint("Jun", 83));
            HighTemperature.Add(new ChartDataPoint("Jul", 87));
            HighTemperature.Add(new ChartDataPoint("Aug", 84));
            HighTemperature.Add(new ChartDataPoint("Sep", 78));
            HighTemperature.Add(new ChartDataPoint("Oct", 67));
            HighTemperature.Add(new ChartDataPoint("Nov", 55));
            HighTemperature.Add(new ChartDataPoint("Dec", 45));

            InitializeComponent();
        }

***************************************************************************

Michal
Replied On June 20, 2016 07:16 AM UTC

After reading some forums threads, I fugured this out, my defenition didn't have all the necessary properties


changed the def to this, and it worked


<chart:SfChart x:Name="Chart" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">


        <chart:SfChart.Legend>

          <chart:ChartLegend/>

        </chart:SfChart.Legend>

        <chart:SfChart.Title>

          <chart:ChartTitle Text="Student Score"/>

        </chart:SfChart.Title>

        <chart:SfChart.PrimaryAxis>

          <chart:CategoryAxis>

            <chart:CategoryAxis.Title>

              <chart:ChartAxisTitle Text="Name"/>

            </chart:CategoryAxis.Title>

          </chart:CategoryAxis>

        </chart:SfChart.PrimaryAxis>

        <chart:SfChart.SecondaryAxis>

          <chart:NumericalAxis>

            <chart:NumericalAxis.Title>

              <chart:ChartAxisTitle Text="Score"/>

            </chart:NumericalAxis.Title>

          </chart:NumericalAxis>

        </chart:SfChart.SecondaryAxis>

        <chart:SfChart.Series>

          <chart:BarSeries  Label = "High" ItemsSource = "{Binding Students}" XBindingPath="Name"
              EnableAnimation = "true"
              AnimationDuration="0.8"
 YBindingPath="Score"/>

        </chart:SfChart.Series>

      </chart:SfChart>

Saravana Pandian Murugan [Syncfusion]
Replied On June 21, 2016 05:36 AM UTC

Hi Michal,

Thanks for update. We are glad that your issue is resolved. Please let us know if you need any further assistance.

Thanks,
Saravana Pandian M.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;