zz-chart
Version:
Alauda Chart components by Alauda Frontend Team
38 lines • 1.12 kB
JavaScript
import { omit } from 'lodash-es';
import { getSeriesPathType } from '../../strategy/utils.js';
import { ShapeType } from '../../utils/index.js';
import { Shape } from './index.js';
/**
* Area 面积图
*/
export default class Area extends Shape {
constructor(ctrl, opt = {}) {
super(ctrl, opt);
this.type = ShapeType.Area;
this.ctrl.setShape(this.type, this);
}
map(name) {
this.mapName = name;
return this;
}
getSeries() {
const baseSeries = this.getBaseSeries();
return this.getData().map(({ color, name }) => {
return {
stroke: color,
label: name,
...(omit(this.option, 'alpha')),
...getSeriesPathType(this.type, color, this.option),
...baseSeries,
...(baseSeries.points && {
points: {
...baseSeries.points,
fill: color,
space: 0,
},
}),
};
});
}
}
//# sourceMappingURL=area.js.map