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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to bind Series from MVVM pattern in Xamarin.Forms Chart?

Platform: Xamarin.Forms |
Control: SfChart

You can bind the Series property of SfChart from MVVM pattern by using ChartSeriesCollection and setting the ViewModel as BindingContext.


The following code sample demonstrates how to bind the Series property from MVVM pattern.


<chart:SfChart HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Series="{Binding SeriesCollection}">
                <chart:NumericalAxis />


public class ViewModel : INotifyPropertyChanged
        private ChartSeriesCollection seriesCollection;
        public ChartSeriesCollection SeriesCollection
            get { return seriesCollection; }
                seriesCollection = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SeriesCollection"));
        public ViewModel()
            SeriesCollection = new ChartSeriesCollection();
            ColumnSeries columnSeries = new ColumnSeries()
                ItemsSource = ColumnData,
                XBindingPath = "XValue",
                YBindingPath = "YValue"
            LineSeries lineSeries = new LineSeries()
                ItemsSource = LineData,
                XBindingPath = "XValue",
                YBindingPath = "YValue"


2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile