]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | Ext.define('KitchenSink.view.charts.line.BasicController', {\r |
2 | extend: 'Ext.app.ViewController',\r | |
3 | alias: 'controller.line-basic',\r | |
4 | \r | |
5 | onAxisLabelRender: function (axis, label, layoutContext) {\r | |
6 | // Custom renderer overrides the native axis label renderer.\r | |
7 | // Since we don't want to do anything fancy with the value\r | |
8 | // ourselves except appending a '%' sign, but at the same time\r | |
9 | // don't want to loose the formatting done by the native renderer,\r | |
10 | // we let the native renderer process the value first.\r | |
11 | return layoutContext.renderer(label) + '%';\r | |
12 | },\r | |
13 | \r | |
14 | onSeriesTooltipRender: function (tooltip, record, item) {\r | |
15 | tooltip.setHtml(record.get('month') + ': ' + record.get('data1') + '%');\r | |
16 | },\r | |
17 | \r | |
18 | onItemHighlightChange: function (chart, newHighlightItem, oldHighlightItem) {\r | |
19 | this.setSeriesLineWidth(newHighlightItem, 4);\r | |
20 | this.setSeriesLineWidth(oldHighlightItem, 2);\r | |
21 | },\r | |
22 | \r | |
23 | setSeriesLineWidth: function (item, lineWidth) {\r | |
24 | if (item) {\r | |
25 | item.series.setStyle({\r | |
26 | lineWidth: lineWidth\r | |
27 | });\r | |
28 | }\r | |
29 | },\r | |
30 | \r | |
31 | onPreview: function () {\r | |
32 | var chart = this.lookupReference('chart');\r | |
33 | chart.preview();\r | |
34 | }\r | |
35 | \r | |
36 | }); |