Members  Example 

SfChart Class

Represents a root class for chart control which is used to plot a series of points in cartesian co-ordinate system or visualize the points using non-cartesian chart types.
Object Model
SfChart ClassChartAxisCollection ClassChartAxis ClassChartAnnotationCollection ClassChartAnnotation ClassChartBehaviorCollection ClassChartBehavior ClassChartColorModel ClassChartLegend ClassChartAxis ClassRangeAxisBase ClassChartSeriesCollection ClassChartSeries ClassTechnicalIndicatorCollection ClassFinancialTechnicalIndicator ClassChartTitle Class
public class SfChart : Xamarin.Forms.View, Xamarin.Forms.IAnimatable, Xamarin.Forms.IElementController, Xamarin.Forms.IViewController, Xamarin.Forms.IVisualElementController  
SfChart can plot multiple charts and used as a container view to display legend, axis and multiple chart series. Multiple chart series can be specified using Series property. Axis can be specified using PrimaryAxis and SecondaryAxis properties. Legend can be customized using Legend property. Since SfChart is a container view for both cartesian and non-cartesian charts, it can plot either cartesian or non-cartesian chart at a time when the Series collection contains mixed chart types.
SfChart chart = new SfChart();
this.BindingContext = new ViewModel();
chart.Title.Text = "Chart";
chart.Legend = new ChartLegend ();
CategoryAxis primaryAxis = new CategoryAxis();
primaryAxis.Title.Text = "Name";
chart.PrimaryAxis = primaryAxis;
NumericalAxis secondaryAxis = new NumericalAxis();
secondaryAxis.Title.Text = "Height (in cm)";
chart.SecondaryAxis = secondaryAxis;
ColumnSeries series = new ColumnSeries();
series.SetBinding(ChartSeries.ItemsSourceProperty, "Data");
series.Label = "Heights";
series.XBindingPath = "Name";
series.YBindingPath = "Height";
series.DataMarker = new ChartDataMarker();
series.EnableTooltip = true;
public class ViewModel  
      public List<Person> Data { get; set; }
      public ViewModel()
            Data = new List<Person>()
                new Person { Name = "David", Height = 180 },
                new Person { Name = "Michael", Height = 170 },
                new Person { Name = "Steve", Height = 160 },
                new Person { Name = "Joel", Height = 182 }
  public class Person   
  public string Name { get; set; }
  public double Height { get; set; }
Inheritance Hierarchy



Syncfusion.SfChart.XForms: 16.4451.0.42

See Also