1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-chart.axis.Numeric-method-constructor'><span id='Ext-chart.axis.Numeric'>/**
2 </span></span> * @class Ext.chart.axis.Numeric
3 * @extends Ext.chart.axis.Axis
5 * An axis to handle numeric values. This axis is used for quantitative data as
6 * opposed to the category axis. You can set mininum and maximum values to the
7 * axis so that the values are bound to that. If no values are set, then the
8 * scale will auto-adjust to the values.
10 * {@img Ext.chart.axis.Numeric/Ext.chart.axis.Numeric.png Ext.chart.axis.Numeric chart axis}
14 * var store = Ext.create('Ext.data.JsonStore', {
15 * fields: ['name', 'data1', 'data2', 'data3', 'data4', 'data5'],
17 * {'name':'metric one', 'data1':10, 'data2':12, 'data3':14, 'data4':8, 'data5':13},
18 * {'name':'metric two', 'data1':7, 'data2':8, 'data3':16, 'data4':10, 'data5':3},
19 * {'name':'metric three', 'data1':5, 'data2':2, 'data3':14, 'data4':12, 'data5':7},
20 * {'name':'metric four', 'data1':2, 'data2':14, 'data3':6, 'data4':1, 'data5':23},
21 * {'name':'metric five', 'data1':27, 'data2':38, 'data3':36, 'data4':13, 'data5':33}
25 * Ext.create('Ext.chart.Chart', {
26 * renderTo: Ext.getBody(),
34 * fields: ['data1', 'data2', 'data3', 'data4', 'data5'],
35 * title: 'Sample Values',
45 * adjustMinimumByMajorUnit: 0
50 * title: 'Sample Metrics',
63 * yField: ['data1', 'data2', 'data3', 'data4', 'data5'],
70 * In this example we create an axis of Numeric type. We set a minimum value so that
71 * even if all series have values greater than zero, the grid starts at zero. We bind
72 * the axis onto the left part of the surface by setting <em>position</em> to <em>left</em>.
73 * We bind three different store fields to this axis by setting <em>fields</em> to an array.
74 * We set the title of the axis to <em>Number of Hits</em> by using the <em>title</em> property.
75 * We use a <em>grid</em> configuration to set odd background rows to a certain style and even rows
76 * to be transparent/ignored.
80 Ext.define('Ext.chart.axis.Numeric', {
82 /* Begin Definitions */
84 extend: 'Ext.chart.axis.Axis',
86 alternateClassName: 'Ext.chart.NumericAxis',
92 alias: 'axis.numeric',
94 constructor: function(config) {
95 var me = this, label, f;
96 me.callParent([config]);
98 if (me.roundToDecimal === false) {
101 if (label.renderer) {
103 label.renderer = function(v) {
104 return me.roundToDecimal( f(v), me.decimals );
107 label.renderer = function(v) {
108 return me.roundToDecimal(v, me.decimals);
113 roundToDecimal: function(v, dec) {
114 var val = Math.pow(10, dec || 0);
115 return ((v * val) >> 0) / val;
118 <span id='Ext-chart.axis.Numeric-property-minimum'> /**
119 </span> * The minimum value drawn by the axis. If not set explicitly, the axis
120 * minimum will be calculated automatically.
127 <span id='Ext-chart.axis.Numeric-property-maximum'> /**
128 </span> * The maximum value drawn by the axis. If not set explicitly, the axis
129 * maximum will be calculated automatically.
136 <span id='Ext-chart.axis.Numeric-property-decimals'> /**
137 </span> * The number of decimals to round the value to.
145 <span id='Ext-chart.axis.Numeric-property-scale'> /**
146 </span> * The scaling algorithm to use on this axis. May be "linear" or
147 * "logarithmic".
152 scale: "linear",
154 <span id='Ext-chart.axis.Numeric-property-position'> /**
155 </span> * Indicates the position of the axis relative to the chart
162 <span id='Ext-chart.axis.Numeric-property-adjustMaximumByMajorUnit'> /**
163 </span> * Indicates whether to extend maximum beyond data's maximum to the nearest
166 * @property adjustMaximumByMajorUnit
169 adjustMaximumByMajorUnit: false,
171 <span id='Ext-chart.axis.Numeric-property-adjustMinimumByMajorUnit'> /**
172 </span> * Indicates whether to extend the minimum beyond data's minimum to the
175 * @property adjustMinimumByMajorUnit
178 adjustMinimumByMajorUnit: false,
180 // @private apply data.
181 applyData: function() {
183 return this.calcEnds();
186 </pre></pre></body></html>