-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(funnel): 修复漏斗图数据为0时,出现conversionTag 样式问题 (#2893)
- Loading branch information
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Funnel } from '../../src'; | ||
import { createDiv } from '../utils/dom'; | ||
|
||
describe('#2651', () => { | ||
it('funnel render normal when data is null or zero', () => { | ||
const data = [ | ||
{ stage: '简历筛选', number: 10 }, | ||
{ stage: '初试人数', number: 8 }, | ||
{ stage: '复试人数', number: 7 }, | ||
{ stage: '录取人数', number: 6 }, | ||
{ stage: '入职人数', number: 5 }, | ||
]; | ||
|
||
const plot = new Funnel(createDiv(), { | ||
data: data, | ||
xField: 'stage', | ||
yField: 'number', | ||
legend: false, | ||
}); | ||
|
||
plot.render(); | ||
expect(plot.chart.getController('annotation').getComponents().length).toBe(4); | ||
|
||
plot.changeData([ | ||
{ stage: '简历筛选', number: 0 }, | ||
{ stage: '初试人数', number: 0 }, | ||
{ stage: '复试人数', number: 4 }, | ||
{ stage: '录取人数', number: 0 }, | ||
{ stage: '入职人数', number: 0 }, | ||
]); | ||
expect(plot.chart.getController('annotation').getComponents().length).toBe(4); | ||
|
||
plot.changeData([ | ||
{ stage: '简历筛选', number: 0 }, | ||
{ stage: '初试人数', number: 0 }, | ||
{ stage: '复试人数', number: 0 }, | ||
{ stage: '录取人数', number: 0 }, | ||
{ stage: '入职人数', number: 0 }, | ||
]); | ||
expect(plot.chart.getController('annotation').getComponents().length).toBe(0); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters