]>
git.proxmox.com Git - sencha-touch.git/blob - src/src/chart/axis/segmenter/Segmenter.js
3 * @class Ext.chart.axis.segmenter.Segmenter
5 * Interface for a segmenter in an Axis. A segmenter defines the operations you can do to a specific
8 * See {@link Ext.chart.axis.Axis}.
11 Ext
.define('Ext.chart.axis.segmenter.Segmenter', {
15 * @cfg {Ext.chart.axis.Axis} axis The axis that the Segmenter is bound.
20 constructor: function (config
) {
21 this.initConfig(config
);
25 * This method formats the value.
27 * @param {*} value The value to format.
28 * @param {Object} context Axis layout context.
31 renderer: function (value
, context
) {
36 * Convert from any data into the target type.
37 * @param {*} value The value to convert from
38 * @return {*} The converted value.
40 from: function (value
) {
45 * Returns the difference between the min and max value based on the given unit scale.
47 * @param {*} min The smaller value.
48 * @param {*} max The larger value.
49 * @param {*} unit The unit scale. Unit can be any type.
50 * @return {Number} The number of `unit`s between min and max. It is the minimum n that min + n * unit >= max.
55 * Align value with step of units.
56 * For example, for the date segmenter, if the unit is "Month" and step is 3, the value will be aligned by
59 * @param {*} value The value to be aligned.
60 * @param {Number} step The step of units.
61 * @param {*} unit The unit.
62 * @return {*} Aligned value.
67 * Add `step` `unit`s to the value.
68 * @param {*} value The value to be added.
69 * @param {Number} step The step of units. Negative value are allowed.
70 * @param {*} unit The unit.
75 * Given a start point and estimated step size of a range, determine the preferred step size.
77 * @param {*} start The start point of range.
78 * @param {*} estStepSize The estimated step size.
79 * @return {Object} Return the step size by an object of step x unit.
80 * @return {Number} return.step The step count of units.
81 * @return {Number|Object} return.unit The unit.
83 preferredStep
: Ext
.emptyFn