File "axisModelCommonMixin.js"
Full Path: /home/cananyalcin/public_html/vendors/echarts/src/coord/axisModelCommonMixin.js
File size: 826 bytes
MIME-type: text/plain
Charset: utf-8
define(function (require) {
var zrUtil = require('zrender/core/util');
var axisHelper = require('./axisHelper');
function getName(obj) {
if (zrUtil.isObject(obj) && obj.value != null) {
return obj.value;
}
else {
return obj;
}
}
/**
* Get categories
*/
function getCategories() {
return this.get('type') === 'category'
&& zrUtil.map(this.get('data'), getName);
}
/**
* Format labels
* @return {Array.<string>}
*/
function getFormattedLabels() {
return axisHelper.getFormattedLabels(
this.axis,
this.get('axisLabel.formatter')
);
}
return {
getFormattedLabels: getFormattedLabels,
getCategories: getCategories
};
});