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 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 } |
OLD | NEW |