OLD | NEW |
| (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 @anonymous | |
19 class Data { | |
20 external List get labels; | |
21 external List<DataSet> get datasets; | |
22 | |
23 external factory Data({List<String> labels, List<DataSet> datasets}); | |
24 } | |
25 | |
26 /// Minimal implementation of dataset for line chart | |
27 /// | |
28 /// http://www.chartjs.org/docs/#line-chart-data-structure | |
29 @JS() | |
30 @anonymous | |
31 class DataSet { | |
32 external String get label; | |
33 external String get fillColor; | |
34 external String get strokeColor; | |
35 external String get pointColor; | |
36 external String get pointStrokeColor; | |
37 external String get pointHighlightFill; | |
38 external String get pointHighlightStroke; | |
39 | |
40 external List<num> get data; | |
41 | |
42 external factory DataSet( | |
43 {String label, | |
44 String fillColor, | |
45 String strokeColor, | |
46 String pointColor, | |
47 String pointStrokeColor, | |
48 String pointHighlightFill, | |
49 String pointHighlightStroke, | |
50 List<num> data}); | |
51 } | |
52 | |
53 /// Minimal implementation of options | |
54 /// | |
55 /// http://www.chartjs.org/docs/#getting-started-global-chart-configuration | |
56 @JS() | |
57 @anonymous | |
58 class Options { | |
59 external bool get responsive; | |
60 | |
61 external factory Options({bool responsive}); | |
62 } | |
OLD | NEW |