Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Side by Side Diff: pkg/js/example/chart_js_example.dart

Issue 1449053004: pkg/js: moved example code to https://github.com/google/chartjs.dart/ (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: nits Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/js/example/chart.dart ('k') | pkg/js/example/index.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library chart.example;
6
7 // Based off the Javascript example
8 // https://github.com/nnnick/Chart.js/blob/b8691c9581bff0eeecb34f98e678dc045a18f 33e/samples/line.html
9 // On 2015-10-15
10
11 import 'dart:html';
12 import 'dart:math';
13
14 import 'chart.dart';
15
16 void main() {
17 var ctx = (querySelector('#canvas') as CanvasElement).context2D;
18
19 var rnd = new Random();
20
21 var data = new Data(labels: [
22 "January",
23 "February",
24 "March",
25 "April",
26 "May",
27 "June",
28 "July"
29 ], datasets: <DataSet>[
30 new DataSet(
31 label: "My First dataset",
32 fillColor: "rgba(220,220,220,0.2)",
33 strokeColor: "rgba(220,220,220,1)",
34 pointColor: "rgba(220,220,220,1)",
35 pointStrokeColor: "#fff",
36 pointHighlightFill: "#fff",
37 pointHighlightStroke: "rgba(220,220,220,1)",
38 data: [
39 rnd.nextInt(100),
40 rnd.nextInt(100),
41 rnd.nextInt(100),
42 rnd.nextInt(100),
43 rnd.nextInt(100),
44 rnd.nextInt(100),
45 rnd.nextInt(100)
46 ]),
47 new DataSet(
48 label: "My Second dataset",
49 fillColor: "rgba(151,187,205,0.2)",
50 strokeColor: "rgba(151,187,205,1)",
51 pointColor: "rgba(151,187,205,1)",
52 pointStrokeColor: "#fff",
53 pointHighlightFill: "#fff",
54 pointHighlightStroke: "rgba(151,187,205,1)",
55 data: [
56 rnd.nextInt(100),
57 rnd.nextInt(100),
58 rnd.nextInt(100),
59 rnd.nextInt(100),
60 rnd.nextInt(100),
61 rnd.nextInt(100),
62 rnd.nextInt(100)
63 ])
64 ]);
65
66 new Chart(ctx).Line(data, new Options(responsive: true));
67 }
OLDNEW
« no previous file with comments | « pkg/js/example/chart.dart ('k') | pkg/js/example/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698