Xamarin.Forms: Putting A Label Inside A PieChart Layout
<p>Good Day. I'm creating a Xamarin.Forms Portable Application where I was able to display there a Chart using OxyPlot. </p>

<p>My problem is how am I going to put a <strong>TOTAL SALES</strong> label in there. Because even if I put the Label in my .XAML page, it doesn't not appear.</p>

<p>I want to put the Label there (inside the Red Border). </p>

<p><a href="https://i.stack.imgur.com/Hb9zM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hb9zM.jpg" alt="enter image description here"></a></p>

<p>What do you think I should do in order to have this?</p>

<p>Here's my code:</p>

<p><strong>SalesViewModel.cs</strong></p>

<pre><code>using OxyPlot;
using OxyPlot.Series;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;


namespace XamarinFormsDemo.ViewModels
{
    public class SalesPerProductViewModel : INotifyPropertyChanged
    {
    private PlotModel modelP1;
    public SalesPerProductViewModel()
    {
        // PieViewModel vm = new PieViewModel();

        modelP1 = new PlotModel
        {
            Title = "Sales Per Product",
            TitleColor = OxyColors.Teal,
            TitleFontSize = 30,
            TextColor = OxyColors.White,
            DefaultFont = "Arial Black",
            DefaultFontSize = 20

        };


        dynamic seriesP1 = new PieSeries { StrokeThickness = 2.0, InsideLabelPosition = 0.8, AngleSpan = 360, StartAngle = 0 };

        seriesP1.Slices.Add(new PieSlice("Keyboard", 5900) { IsExploded = false, Fill = OxyColors.Teal });
        seriesP1.Slices.Add(new PieSlice("Monitor", 4430) { IsExploded = true });
        seriesP1.Slices.Add(new PieSlice("Flash Drive", 11620) { IsExploded = true });
        seriesP1.Slices.Add(new PieSlice("Hard Drive", 7000) { IsExploded = true });
        seriesP1.Slices.Add(new PieSlice("RAM", 8000) { IsExploded = true });

        modelP1.Series.Add(seriesP1);
        this.SalesPerProductModel = modelP1;

    }

    public PlotModel SalesPerProductModel { get; private set; }



    public event PropertyChangedEventHandler PropertyChanged;

    protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }

    }
}
</code></pre>

<p><strong>SalesPerProductPage.xaml</strong></p>

<pre><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"
         xmlns:oxy="clr-namespace:OxyPlot.Xamarin.Forms;assembly=OxyPlot.Xamarin.Forms"
         xmlns:ViewModels="clr-namespace:XamarinFormsDemo.ViewModels;assembly=XamarinFormsDemo"
         x:Class="XamarinFormsDemo.Views.SalesPerProductPage"
         BackgroundImage="bg3.jpg"
         Title="Sales Per Product"&gt;


  &lt;ContentPage.BindingContext&gt;
    &lt;ViewModels:SalesPerProductViewModel/&gt;
  &lt;/ContentPage.BindingContext&gt;



  &lt;Label Text="TOTAL SALES LABEL HERE!"
   TextColor="#24e97d"/&gt;

    &lt;oxy:PlotView Model="{Binding SalesPerProductModel}" /&gt;
&lt;/ContentPage&gt;
</code></pre>