define(function(require) {
'use strict';
var SeriesModel = require('../../model/Series');
var createListFromArray = require('../helper/createListFromArray');
return SeriesModel.extend({
type: 'series.bar',
dependencies: ['grid', 'polar'],
getInitialData: function (option, ecModel) {
return createListFromArray(option.data, this, ecModel);
},
getMarkerPosition: function (value) {
var coordSys = this.coordinateSystem;
if (coordSys) {
var pt = coordSys.dataToPoint(value);
var data = this.getData();
var offset = data.getLayout('offset');
var size = data.getLayout('size');
var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;
pt[offsetIndex] += offset + size / 2;
return pt;
}
return [NaN, NaN];
},
defaultOption: {
zlevel: 0, // ????
z: 2, // ????
coordinateSystem: 'cartesian2d',
legendHoverLink: true,
// stack: null
// Cartesian coordinate system
xAxisIndex: 0,
yAxisIndex: 0,
// ??????0
barMinHeight: 0,
// barMaxWidth: null,
// ?????
// barWidth: null,
// ?????????????30%??????
// barGap: '30%',
// ????????????????20%??????
// barCategoryGap: '20%',
// label: {
// normal: {
// show: false
// }
// },
itemStyle: {
normal: {
// color: '??',
// ????
barBorderColor: '#fff',
// ?????????px????1
barBorderWidth: 0
},
emphasis: {
// color: '??',
// ????
barBorderColor: '#fff',
// ?????????px????1
barBorderWidth: 0
}
}
}
});
});
|