]>
Commit | Line | Data |
---|---|---|
947f0963 TL |
1 | Ext.define('KitchenSink.view.charts.line.PlotController', { |
2 | extend: 'Ext.app.ViewController', | |
3 | alias: 'controller.line-plot', | |
4 | ||
5 | onPanZoomReset: function() { | |
6 | var chart = this.lookup('chart'), | |
7 | axes = chart.getAxes(); | |
8 | ||
9 | axes[0].setVisibleRange([0, 1]); | |
10 | axes[1].setVisibleRange([0, 1]); | |
11 | ||
12 | chart.redraw(); | |
13 | }, | |
14 | ||
15 | onRefresh: function() { | |
16 | var chart = this.lookup('chart'), | |
17 | store = chart.getStore(); | |
18 | ||
19 | store.refreshData(); | |
20 | }, | |
21 | ||
22 | onAfterRender: function() { | |
23 | var chart = this.lookup('chart'), | |
24 | toolbar = this.lookup('toolbar'), | |
25 | panzoom = chart.getInteractions()[0]; | |
26 | ||
27 | toolbar.add(panzoom.getModeToggleButton()); | |
28 | }, | |
29 | ||
30 | onPreview: function() { | |
31 | var chart; | |
32 | ||
33 | if (Ext.isIE8) { | |
34 | Ext.Msg.alert('Unsupported Operation', 'This operation requires a newer version of Internet Explorer.'); | |
35 | ||
36 | return; | |
37 | } | |
38 | ||
39 | chart = this.lookup('chart'); | |
40 | ||
41 | chart.preview(); | |
42 | } | |
43 | ||
44 | }); |