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

Y axis values are not appearing using ChartDataPoint Binding

Thread ID:





131851 Jul 31,2017 10:29 AM UTC Aug 1,2017 01:32 PM UTC Xamarin.Forms 1
Tags: SfChart
Asked On July 31, 2017 10:29 AM UTC

I am trying to display date or month in X axis as below, it works fine. I can see the columnseries and weight number on y axis but not months on X axis. I tried alternatively using Date instead of month but I cant see dates either

If i bind directly my AllBodyStats list object by defining binding on XBindingPath an YBindingPath, I can see the dates on X axis. Am I missing something? why it doesnt work using ChartDataPoint


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


                <chart:ChartTitle Text="{Binding ChartTitle}"/>


                <chart:DateTimeAxis IntervalType="Months" Interval="1">


                        <chart:ChartAxisTitle Text="{resx:Translate Date}"></chart:ChartAxisTitle>




                <chart:NumericalAxis  Minimum="0" Maximum="{Binding NumericalAxisMax}" Interval="{Binding NumericalAxisInterval}" >


                        <chart:ChartAxisTitle Text="{Binding NumericalAxisTitle}" ></chart:ChartAxisTitle>





                <chart:ColumnSeries ItemsSource="{Binding NumericMonthStats, Mode=OneWay}"  EnableAnimation = "true" AnimationDuration="0.8" >




        public ObservableCollection<ChartDataPoint> NumericMonthStats{ get; set; }

           foreach (var BodyStat in AllBodyStats.OrderBy(o=>o.DateCreated))
                string month = BodyStat.DateCreated.ToString("MMMM", Helpers.Settings.CurrentCultureInfo);

                    NumericMonthStats.Add(new ChartDataPoint(month, (double)BodyStat.Weight)); // using month
                    NumericMonthStats.Add(new ChartDataPoint(BodyStat.DateCreated.Date, (double)BodyStat.Weight)); // using date

using my custom list object


            <chart:ColumnSeries ItemsSource="{Binding AllBodyStats}" XBindingPath="DateCreated" YBindingPath="Weight">


Saravana Pandian Murugan [Syncfusion]
Replied On August 1, 2017 01:32 PM UTC

Hi Emil, 
Thanks for contacting Syncfusion support. 
We are not able to reproduce the reported issue at our end and we have prepared a sample for this. Please update us the modified sample to reproduce the issue which will be helpful for providing further assistance on this. 
Note: If you bind the custom object, you should bind the model properties. If you bind Data using ChartDataPoint and update the data dynamically, you should set XBindingPath as “XValue” and YBindingPath as “YValue” as per the below code. But we always recommend you to set XBindingPath as “XValue” and YBindingPath as “YValue” if you bind ChartDataPoint object. 
Code Example:  
          <chart:ColumnSeries ItemsSource="{Binding NumericMonthStats}" XBindingPath="XValue" YBindingPath="YValue"> 
         <chart:LineSeries ItemsSource="{Binding NumericMonthStats1}" XBindingPath="Date" YBindingPath="Weight"/> 
Please check the attached sample. If you are still facing this issue, please update us the modified sample. 
Saravana Pandian M. 


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

This page will automatically be redirected to the 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