Skip to content

Commit

Permalink
fix(issue-3160): 修复饼图使用连续型图例,标签无法展示
Browse files Browse the repository at this point in the history
color 字段为 linear 类型时,不会存入 groupScales,导致获取 label-id 不唯一

closed: #3160
  • Loading branch information
visiky committed Apr 10, 2021
1 parent e63fa39 commit 3a076ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/geometry/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,11 @@ export default class Geometry extends Base {
id = `${xVal}-${yVal}`;
}

const groupScales = this.groupScales;
let groupScales = [...this.groupScales];
if (isEmpty(groupScales)) {
groupScales = get(this.getAttribute('color'), 'scales', []);
}

for (let index = 0, length = groupScales.length; index < length; index++) {
const groupScale = groupScales[index];
const field = groupScale.field;
Expand Down

0 comments on commit 3a076ca

Please sign in to comment.