OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. All rights reserved. | 2 * Copyright 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style | 4 * Use of this source code is governed by a BSD-style |
5 * license that can be found in the LICENSE file or at | 5 * license that can be found in the LICENSE file or at |
6 * https://developers.google.com/open-source/licenses/bsd | 6 * https://developers.google.com/open-source/licenses/bsd |
7 */ | 7 */ |
8 | 8 |
9 library charted.demo.charts.cartesian_renderers; | 9 library charted.demo.charts.cartesian_renderers; |
10 | 10 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 181 |
182 charts.forEach((ChartDemo x) => x.draw()); | 182 charts.forEach((ChartDemo x) => x.draw()); |
183 } | 183 } |
184 | 184 |
185 main() { | 185 main() { |
186 new tm.TextMetrics(fontStyle: '14px Roboto'); | 186 new tm.TextMetrics(fontStyle: '14px Roboto'); |
187 draw_charts(); | 187 draw_charts(); |
188 | 188 |
189 Element chartsContainer = querySelector('.demos-container'); | 189 Element chartsContainer = querySelector('.demos-container'); |
190 InputElement useRTLScriptCheckBox = querySelector('#rtl-use-script'), | 190 InputElement useRTLScriptCheckBox = querySelector('#rtl-use-script'), |
191 switchAxesForRTLCheckBox = querySelector('#rtl-switch-axes'), | |
192 useRTLLayoutCheckBox = querySelector('#rtl-use-layout'); | 191 useRTLLayoutCheckBox = querySelector('#rtl-use-layout'); |
193 | 192 |
194 useRTLLayoutCheckBox.onChange.listen((_) { | 193 useRTLLayoutCheckBox.onChange.listen((_) { |
195 bool isRTL = useRTLLayoutCheckBox.checked; | 194 bool isRTL = useRTLLayoutCheckBox.checked; |
196 charts.forEach((ChartDemo x) => x.config.isRTL = isRTL); | 195 charts.forEach((ChartDemo x) => x.config.isRTL = isRTL); |
197 chartsContainer.attributes['dir'] = isRTL ? 'rtl' : 'ltr'; | 196 chartsContainer.attributes['dir'] = isRTL ? 'rtl' : 'ltr'; |
198 }); | 197 }); |
199 | 198 |
200 useRTLScriptCheckBox.onChange.listen((_) { | 199 useRTLScriptCheckBox.onChange.listen((_) { |
201 bool isRTL = useRTLScriptCheckBox.checked; | 200 bool isRTL = useRTLScriptCheckBox.checked; |
202 Iterable DATA_SOURCE = isRTL | 201 List<List> DATA_SOURCE = isRTL |
203 ? ORDINAL_DATA_RTL | 202 ? ORDINAL_DATA_RTL |
204 : ORDINAL_DATA; | 203 : ORDINAL_DATA; |
205 charts.forEach((ChartDemo x) { | 204 charts.forEach((ChartDemo x) { |
206 x.area.data = new ChartData(ORDINAL_DATA_COLUMNS, DATA_SOURCE); | 205 x.area.data = new ChartData(ORDINAL_DATA_COLUMNS, DATA_SOURCE); |
207 x.draw(); | 206 x.draw(); |
208 }); | 207 }); |
209 }); | 208 }); |
210 } | 209 } |
OLD | NEW |