]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | Ext.define('KitchenSink.view.charts.area.Stacked100Controller', {\r |
2 | extend: 'Ext.app.ViewController',\r | |
3 | alias: 'controller.area-stacked-100',\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 | var fieldIndex = Ext.Array.indexOf(item.series.getYField(), item.field),\r | |
16 | browser = item.series.getTitle()[fieldIndex];\r | |
17 | \r | |
18 | tooltip.setHtml(browser + ' on ' + record.get('month') + ': ' +\r | |
19 | record.get(item.field) + '%');\r | |
20 | },\r | |
21 | \r | |
22 | onColumnRender: function (v) {\r | |
23 | return v + '%';\r | |
24 | },\r | |
25 | \r | |
26 | onPreview: function () {\r | |
27 | var chart = this.lookupReference('chart');\r | |
28 | chart.preview();\r | |
29 | }\r | |
30 | \r | |
31 | }); |