Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(label): 增加label单测,解决数据量过多,lable自动隐藏场景下报错问题 #6132

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions tests/bugs/6114-spec.ts
Original file line number Diff line number Diff line change
@@ -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)

})
})
Loading