From 6b0d07cfdbd6746d1a0e7c1ccdb8f61de08eae4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=A6=E9=80=9A?= Date: Thu, 14 Mar 2024 16:36:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(label):=20=E5=A2=9E=E5=8A=A0label=E5=8D=95?= =?UTF-8?q?=E6=B5=8B=EF=BC=8C=E8=A7=A3=E5=86=B3=E6=95=B0=E6=8D=AE=E9=87=8F?= =?UTF-8?q?=E8=BF=87=E5=A4=9A,lable=E8=87=AA=E5=8A=A8=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E4=B8=8B=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/bugs/6114-spec.ts | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/bugs/6114-spec.ts diff --git a/tests/bugs/6114-spec.ts b/tests/bugs/6114-spec.ts new file mode 100644 index 0000000000..d77dcf454e --- /dev/null +++ b/tests/bugs/6114-spec.ts @@ -0,0 +1,48 @@ +import { Chart } from '../../src'; +import { createDiv } from '../util/dom'; +import { delay } from '../util/delay'; + +/** + * 增加 label -->> layout 特定情况报错 + * 报错详情具体查看 https://github.com/antvis/G2/issues/6114 + * 此问题在G代码中修复掉了 + * + */ +describe('#6114', () => { + it('dual-axes-label-layout.spec', async () => { + + const group = Array.from({ length: 500 }, (value, index) => { + return { + time: index, + waiting: index * (Math.random() * 10), + people: index * (Math.random() * 10), + } + }) + + const chart = new Chart({ + container: createDiv(), + autoFit: true, + height: 500 + }); + chart.data(group); + chart.interval() + .position('time*waiting') + .color('#3182bd') + .label('waiting', { + layout: [{ type: 'limit-in-plot', }], + }) + chart.line() + .position('time*people') + .color('#fdae6b') + .size(3) + .shape('smooth') + .label('people', { + layout: [{ type: 'overlap' }, { type: 'limit-in-plot', cfg: { action: 'translate' } },], + }) + + + chart.render(); + // await delay(20) + + }) +})