This project is read-only.

How to use SparrowChart without MVVM?

Feb 1, 2014 at 2:21 PM
I am getting into SparrowChart and I set up the XAML like the tutorial wants me to
        <sparrow:LinearXAxis />
        <sparrow:LinearYAxis />
    <sparrow:LineSeries Stroke="#FF666666"
        PointsSource="{Binding Collection}"
        YPath="Y" />
But now I want to add the points of the chart not via MVVM.
But since SparrowChart doesn't have a ItemSource property, I am wondering how I can add points to the chart by hand in C#.

In my class I have
public ObservableCollection<GraphPoint> Collection 
    = new ObservableCollection<GraphPoint>();

public class GraphPoint
    public double X { get; set; }
    public double Y { get; set; }

    public GraphPoint (double x, double y)
        X = x;
        Y = y;

//Page, where the chart is in

public Stats()

    for (int i = 0; i < 10; i+=1)
        GraphPoint g = new GraphPoint(i, i+1);
But the chart isn't adding the points.
Feb 26, 2014 at 11:26 PM
I was able to do it in code like this:
var series = new AreaSeries();
series.XPath = "X";
series.YPath = "Y";
series.PointsSource = GetPoints();