protected override void OnResume()
 {
     base.OnResume();
     if (mChartView == null)
     {
         LinearLayout layout = FindViewById<LinearLayout>(Resource.Id.chart);
         mChartView = ChartFactory.GetPieChartView(this, mSeries, mRenderer);
         mRenderer.ClickEnabled = true;
         mChartView.Click += (e, s) =>
         {
             SeriesSelection seriesSelection = mChartView.CurrentSeriesAndPoint;
             if (seriesSelection == null)
             {
                 Toast.MakeText(this, "No chart element selected", ToastLength.Short).Show();
             }
             else
             {
                 for (int i = 0; i < mSeries.ItemCount; i++)
                 {
                     mRenderer.GetSeriesRendererAt(i).Highlighted = (i == seriesSelection.PointIndex);
                 }
                 mChartView.Repaint();
                 Toast.MakeText(this, "Chart data point index " + seriesSelection.PointIndex + " selected "
                     + "point value=" + seriesSelection.Value, ToastLength.Short).Show();
             }
         };
         layout.AddView(mChartView, new Android.Views.ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent,
             ViewGroup.LayoutParams.FillParent));
     }
     else
     {
         mChartView.Repaint();
     }
 }
 protected override void OnResume()
 {
     base.OnResume();
     if (mChartView == null)
     {
         LinearLayout layout = FindViewById<LinearLayout>(Resource.Id.chart);
         mChartView = ChartFactory.GetLineChartView(this, mDataset, mRenderer);
         mRenderer.ClickEnabled = true;
         mRenderer.SelectableBuffer = 10;
         mChartView.Click += (e, s) =>
             {
                 SeriesSelection seriesSelection = mChartView.CurrentSeriesAndPoint;
                 if (seriesSelection == null)
                 {
                     Toast.MakeText(this, "No chart element", ToastLength.Short).Show();
                 }
                 else
                 {
                     Toast.MakeText(this, "Chart element in series index " + seriesSelection.SeriesIndex
                         + " data point index " + seriesSelection.PointIndex + " was clicked"
                         + " closest point value X=" + seriesSelection.XValue + ",Y="
                         + seriesSelection.Value, ToastLength.Short).Show();
                 }
             };
         layout.AddView(mChartView, new Android.Views.ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent,
             ViewGroup.LayoutParams.FillParent));
         bool enabled = mDataset.SeriesCount > 0;
         SetSeriesWidgetsEnabled(enabled);
     }
     else
     {
         mChartView.Repaint();
     }
 }