Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Oxyplot Simple Graph

$
0
0

Hi ,

I am trying to display simple graph using oxyPlot in Xamarin forms.
I am displaying a page when i launch the app

using System;
using Xamarin.Forms;
using OxyPlot;
using OxyPlot.Series;

using OxyPlot.Axes;
using System.Collections.Generic;

namespace graph
{
public class firstPage : ContentPage
{
public firstPage ()
{
var Points = new List
{
new DataPoint(0, 4),
new DataPoint(10, 13),
new DataPoint(20, 15),
new DataPoint(30, 16),
new DataPoint(40, 12),
new DataPoint(50, 12)
};
var m = new PlotModel ("Titleee");
m.PlotType = PlotType.XY;
var s = new LineSeries ();
s.ItemsSource = Points;
m.Series.Add (s);
var opv = new OxyPlotView {
WidthRequest = 300, HeightRequest = 300,
BackgroundColor = Color.Aqua
};
opv.Model = m;

        Content = new StackLayout { 
            Children = {

                opv

            }
        };



    }
}

}

but I am getting error in OxyPlotView.Any body knows how to fix this.I am attaching my project structure as well.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>