plot_window 0.0.39 plot_window: ^0.0.39 copied to clipboard
A library to use a canvas element to plot data
// Copyright (c) 2015, <your name>. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.
import 'package:plot_window/plot_window.dart' as pl;
import 'dart:html';
main() {
pl.Init();
var plotWindow = new pl.PlotWindow(querySelector('#mycanvas'));
var line1 = new pl.Line("line1", new pl.PointList([new Point(1,2), new Point(2,5), new Point(3,-3), new Point(4, 2)]), color:new pl.Color(255,0,0));
var line2 = new pl.Line("line2", new pl.PointList([new Point(-3,3), new Point(-2,2), new Point(-1,3), new Point(0,2), new Point(1,1)])); //, color:new pl.Color(0,0,255));
line2.showLinearRegression= true;
plotWindow..addLine(line1)
..addLine(line2);
plotWindow.plot();
}