3.0 source code
This commit is contained in:
36
OfficeWeb/vendor/touch/src/chart/axis/segmenter/Names.js
vendored
Normal file
36
OfficeWeb/vendor/touch/src/chart/axis/segmenter/Names.js
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @class Ext.chart.axis.segmenter.Names
|
||||
* @extends Ext.chart.axis.segmenter.Segmenter
|
||||
*
|
||||
* Names data type. Names will be calculated as their indices in the methods in this class.
|
||||
* The `preferredStep` always return `{ unit: 1, step: 1 }` to indicate "show every item".
|
||||
*
|
||||
*/
|
||||
Ext.define("Ext.chart.axis.segmenter.Names", {
|
||||
extend: 'Ext.chart.axis.segmenter.Segmenter',
|
||||
alias: 'segmenter.names',
|
||||
|
||||
renderer: function (value, context) {
|
||||
return value;
|
||||
},
|
||||
|
||||
diff: function (min, max, unit) {
|
||||
return Math.floor(max - min);
|
||||
},
|
||||
|
||||
align: function (value, step, unit) {
|
||||
return Math.floor(value);
|
||||
},
|
||||
|
||||
|
||||
add: function (value, step, unit) {
|
||||
return value + step;
|
||||
},
|
||||
|
||||
preferredStep: function (min, estStepSize, minIdx, data) {
|
||||
return {
|
||||
unit: 1,
|
||||
step: 1
|
||||
};
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user