OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <polymer-element name="base-chart" attributes="chartTitle units flotData"> | 8 <dom-module id="base-chart"> |
9 <script> | 9 <script> |
10 'use strict'; | 10 'use strict'; |
11 Polymer('base-chart', { | 11 Polymer({ |
| 12 |
| 13 is: 'base-chart', |
| 14 properties: { |
| 15 chartTitle: { notify: true }, |
| 16 |
| 17 flotData: { |
| 18 notify: true, |
| 19 observer: 'flotDataChanged' |
| 20 }, |
| 21 |
| 22 units: { notify: true } |
| 23 }, |
| 24 |
12 getChartOptions: function() { | 25 getChartOptions: function() { |
13 return {}; | 26 return {}; |
14 }, | 27 }, |
15 | 28 |
16 /** | 29 /** |
17 * Initializes the summary-chart element and its properties. | 30 * Initializes the summary-chart element and its properties. |
18 * This is a custom element lifecycle callback that's called when an | 31 * This is a custom element lifecycle callback that's called when an |
19 * instance of the element is "ready". | 32 * instance of the element is "ready". |
20 */ | 33 */ |
21 ready: function() { | 34 ready: function() { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 * Resizes the chart if it's present. | 96 * Resizes the chart if it's present. |
84 */ | 97 */ |
85 resizeGraph: function() { | 98 resizeGraph: function() { |
86 if (!this.chart) { | 99 if (!this.chart) { |
87 return; | 100 return; |
88 } | 101 } |
89 this.updateChart(); | 102 this.updateChart(); |
90 } | 103 } |
91 }); | 104 }); |
92 </script> | 105 </script> |
93 </polymer-element> | 106 </dom-module> |
OLD | NEW |