Skip to content

Commit

Permalink
adjust area-label style
Browse files Browse the repository at this point in the history
  • Loading branch information
paleface001 committed Nov 19, 2019
1 parent 90ac31b commit 050b848
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/plots/percentage-stack-column/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default class PercentageStackColumnLayer extends StackColumn<PercentageSt
label: {
visible: true,
position: 'middle',
offset: 0,
},
yAxis: {
visible: true,
Expand Down
1 change: 1 addition & 0 deletions src/plots/stack-area/component/label/area-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class AreaLabel extends ElementLabels {
private scaleFactor: number[] = [];

public showLabels(points: any, shapes: Shape[]) {
console.log(this.get('labelOptions'));
// 获取堆叠字段
const stackField = this.get('element').get('attrs').color.scales[0].field;
// 根据stackField将point分组
Expand Down
7 changes: 7 additions & 0 deletions src/plots/stack-area/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ export default class StackAreaLayer<T extends StackAreaLayerConfig = StackAreaLa
label.offset = 0;
}

if (labelType === 'area') {
label.style = _.deepMix({}, label.style, {
lineWidth: 0,
stroke: 'rgba(0,0,0,0)',
});
}

this.area.label = getComponent('label', {
fields: [this.getLabelField(labelType, props)],
labelType,
Expand Down

0 comments on commit 050b848

Please sign in to comment.