Skip to content

Commit

Permalink
fix(data): fix for data.labels=false
Browse files Browse the repository at this point in the history
Make sure to not execute .redrawText() when data.labels set to 'false'.

Ref #1444
  • Loading branch information
netil committed Jun 15, 2020
1 parent 8a8d1d1 commit b7a0972
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ChartInternal/internals/redraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default {
}

if (!$$.hasArcType() || hasRadar) {
notEmpty(config.data_labels) &&
notEmpty(config.data_labels) && config.data_labels !== false &&
list.push($$.redrawText(xForText, yForText, flow, isTransition));
}

Expand Down
9 changes: 9 additions & 0 deletions test/internals/data-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,15 @@ describe("DATA", () => {
expect(texts.empty()).to.be.false;
expect(texts.size() > 0).to.be.true;
});

it("set option data.labels=false", () => {
args.data.labels = false;
});

it("shouldn't be thrown error", () => {
// reaching this test, means test was passed.
expect(true).to.be.true;
});
});

describe("on area chart", () => {
Expand Down

0 comments on commit b7a0972

Please sign in to comment.