title: How to Create Charts in Xamarin.Forms Portable Application using OxyPlot?
body: <p>Good Day everyone. I'm creating a Xamarin.Forms Portable Application and I want to display there a Chart using a OxyPlot. </p>
  
  <p>But the codes I've found on the Internet doesn't seem to work fine. I just want to ask how am I going to create a Chart, specifically Pie Chart here in OxyPlot. Starting from my XAML to XAML.cs and to other files like model and viewmodel.</p>
  
  <p>Can you please somehow provide me some instructions or code maybe on how am I going to do this?</p>
  
  <p>I want the Chart to be coded here in my SalesPage.</p>
  
  <p><strong>SalesPage.xaml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
           x:Class="XamarinFormsDemo.Views.SalesPage"
           xmlns:oxy="clr-namespace:OxyPlot.Xamarin.Forms;assembly=OxyPlot.Xamarin.Forms"
           BackgroundImage="bg3.jpg"
           Title="Sales Page"&gt;
  
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p><strong>SalesPage.xaml.cs</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using OxyPlot;
  using Xamarin.Forms;
  using OxyPlot.Xamarin.Forms;
  
  namespace XamarinFormsDemo.Views
      {
          public partial class SalesPage : ContentPage
          {       
          public SalesPage()
          {
              InitializeComponent();
          }
      }
  }
  </code></pre>
  
  <p><strong>MainActivity.cs</strong></p>
  
  <pre><code>using System;
  using Android.App;
  using Android.Content.PM;
  using Android.Runtime;
  using Android.Views;
  using Android.Widget;
  using Android.OS;
  using ImageCircle.Forms.Plugin.Droid;
  
  namespace XamarinFormsDemo.Droid
  {
      [Activity(Label = "XamarinFormsDemo", Icon = "@drawable/recordsicon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
  public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
      {
          protected override void OnCreate(Bundle bundle)
          {
          base.OnCreate(bundle);
          global::Xamarin.Forms.Forms.Init(this, bundle);
          OxyPlot.Xamarin.Forms.Platform.Android.PlotViewRenderer.Init();
          LoadApplication(new App());
          ImageCircleRenderer.Init();
          }
      }
  }
  </code></pre>
  
  <p>This is actually my first time to create Charts so please help me. Thanks for your help. </p>