Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / src / chart / axis / Abstract.js
1 /*
2
3 This file is part of Ext JS 4
4
5 Copyright (c) 2011 Sencha Inc
6
7 Contact:  http://www.sencha.com/contact
8
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
11
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
13
14 */
15 /**
16  * @class Ext.chart.axis.Abstract
17  * Base class for all axis classes.
18  * @private
19  */
20 Ext.define('Ext.chart.axis.Abstract', {
21
22     /* Begin Definitions */
23
24     requires: ['Ext.chart.Chart'],
25
26     /* End Definitions */
27
28     /**
29      * Creates new Axis.
30      * @param {Object} config (optional) Config options.
31      */
32     constructor: function(config) {
33         config = config || {};
34
35         var me = this,
36             pos = config.position || 'left';
37
38         pos = pos.charAt(0).toUpperCase() + pos.substring(1);
39         //axisLabel(Top|Bottom|Right|Left)Style
40         config.label = Ext.apply(config['axisLabel' + pos + 'Style'] || {}, config.label || {});
41         config.axisTitleStyle = Ext.apply(config['axisTitle' + pos + 'Style'] || {}, config.labelTitle || {});
42         Ext.apply(me, config);
43         me.fields = [].concat(me.fields);
44         this.callParent();
45         me.labels = [];
46         me.getId();
47         me.labelGroup = me.chart.surface.getGroup(me.axisId + "-labels");
48     },
49
50     alignment: null,
51     grid: false,
52     steps: 10,
53     x: 0,
54     y: 0,
55     minValue: 0,
56     maxValue: 0,
57
58     getId: function() {
59         return this.axisId || (this.axisId = Ext.id(null, 'ext-axis-'));
60     },
61
62     /*
63       Called to process a view i.e to make aggregation and filtering over
64       a store creating a substore to be used to render the axis. Since many axes
65       may do different things on the data and we want the final result of all these
66       operations to be rendered we need to call processView on all axes before drawing
67       them.
68     */
69     processView: Ext.emptyFn,
70
71     drawAxis: Ext.emptyFn,
72     addDisplayAndLabels: Ext.emptyFn
73 });
74