diff --git a/__tests__/unit/api/chart.spec.ts b/__tests__/unit/api/chart.spec.ts index a5a39b3e24..3c98cb8bf1 100644 --- a/__tests__/unit/api/chart.spec.ts +++ b/__tests__/unit/api/chart.spec.ts @@ -61,6 +61,14 @@ describe('Chart', () => { }); }); + it('Chart({...}) should set canvas.supportsCSSTransform to true.', async () => { + const chart = new Chart(); + await chart.render(); + expect(chart.getContext().canvas?.getConfig().supportsCSSTransform).toBe( + true, + ); + }); + it('chart.getContainer() should return container.', () => { const container = document.createElement('div'); const chart = new Chart({ container }); diff --git a/src/api/runtime.ts b/src/api/runtime.ts index 2f480727ee..5a418458b4 100644 --- a/src/api/runtime.ts +++ b/src/api/runtime.ts @@ -64,6 +64,7 @@ export class Runtime extends CompositionNode { render(): Promise> { if (this._rendering) return this._addToTrailing(); if (!this._context.canvas) this._createCanvas(); + this._context.canvas.getConfig().supportsCSSTransform = true; this._bindAutoFit(); this._rendering = true; const finished = new Promise>((resolve, reject) =>