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

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

Issue 1411503002: pkg/js: improved readme, added example (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: nits Created 5 years, 2 months 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/README.md ('k') | pkg/js/example/chart_js_example.dart » ('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;
6
7 import 'dart:html';
8 import 'package:js/js.dart';
9
10 @Js()
11 class Chart {
12 external Chart(CanvasRenderingContext2D ctx);
13
14 external dynamic Line(Data data, Options options);
15 }
16
17 @Js()
18 class Data {
19 external List get labels;
20 external List<DataSet> get datasets;
21
22 external factory Data({List<String> labels, List<DataSet> datasets});
23 }
24
25 /// Minimal implementation of dataset for line chart
26 ///
27 /// http://www.chartjs.org/docs/#line-chart-data-structure
28 @Js()
29 class DataSet {
30 external String get label;
31 external String get fillColor;
32 external String get strokeColor;
33 external String get pointColor;
34 external String get pointStrokeColor;
35 external String get pointHighlightFill;
36 external String get pointHighlightStroke;
37
38 external List<num> get data;
39
40 external factory DataSet(
41 {String label,
42 String fillColor,
43 String strokeColor,
44 String pointColor,
45 String pointStrokeColor,
46 String pointHighlightFill,
47 String pointHighlightStroke,
48 List<num> data});
49 }
50
51 /// Minimal implementation of options
52 ///
53 /// http://www.chartjs.org/docs/#getting-started-global-chart-configuration
54 @Js()
55 class Options {
56 external bool get responsive;
57
58 external factory Options({bool responsive});
59 }
OLDNEW
« no previous file with comments | « pkg/js/README.md ('k') | pkg/js/example/chart_js_example.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698