]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | Ext.define('KitchenSink.view.charts.bar.BasicController', {\r |
2 | extend: 'Ext.app.ViewController',\r | |
3 | alias: 'controller.bar-basic',\r | |
4 | \r | |
5 | onAxisLabelRender: function (axis, label, layoutContext) {\r | |
6 | return Ext.util.Format.number(layoutContext.renderer(label) / 1000, '0,000');\r | |
7 | },\r | |
8 | \r | |
9 | onSeriesLabelRender: function (v) {\r | |
10 | return Ext.util.Format.number(v / 1000, '0,000');\r | |
11 | },\r | |
12 | \r | |
13 | onItemEditTooltipRender: function (tooltip, item, target, e) {\r | |
14 | var formatString = '0,000 (billions of USD)',\r | |
15 | record = item.record;\r | |
16 | \r | |
17 | tooltip.setHtml(record.get('country') + ': ' +\r | |
18 | Ext.util.Format.number(target.yValue / 1000, formatString));\r | |
19 | },\r | |
20 | \r | |
21 | onSeriesTooltipRender: function(tooltip, record, item) {\r | |
22 | var formatString = '0,000 (millions of USD)';\r | |
23 | \r | |
24 | tooltip.setHtml(record.get('country') + ': ' +\r | |
25 | Ext.util.Format.number(record.get('ind'), formatString));\r | |
26 | },\r | |
27 | \r | |
28 | onColumnRender: function (v) {\r | |
29 | return v + '%';\r | |
30 | },\r | |
31 | \r | |
32 | onPreview: function () {\r | |
33 | var chart = this.lookupReference('chart');\r | |
34 | chart.preview();\r | |
35 | }\r | |
36 | \r | |
37 | }); |