-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix(label): 图表开启label配置,多次render后卸载图表导致报错(#6104) * chore: add pull_request * chore: node-version由12.X更新为14 --------- Co-authored-by: 王学通 <[email protected]> Co-authored-by: 王学通 <[email protected]>
- Loading branch information
1 parent
f6ce41e
commit a8eabbc
Showing
3 changed files
with
57 additions
and
9 deletions.
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
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
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,48 @@ | ||
import { Chart } from '../../src'; | ||
import { createDiv } from '../util/dom'; | ||
|
||
|
||
describe('#6104', () => { | ||
it('dual-axes-label.spec', async () => { | ||
|
||
const data = [ | ||
{ time: '10:10', call: 4, waiting: 2, people: 2 }, | ||
{ time: '10:15', call: 2, waiting: 6, people: 3 }, | ||
{ time: '10:20', call: 13, waiting: 2, people: 5 }, | ||
{ time: '10:25', call: 9, waiting: 9, people: 1 }, | ||
{ time: '10:30', call: 5, waiting: 2, people: 3 }, | ||
{ time: '10:35', call: 8, waiting: 2, people: 1 }, | ||
{ time: '10:40', call: 13, waiting: 1, people: 2 } | ||
]; | ||
const chart = new Chart({ | ||
container: createDiv(), | ||
autoFit: true, | ||
height: 500 | ||
}); | ||
chart.clear(); | ||
chart.data(data); | ||
chart.interval() | ||
.position('time*waiting') | ||
.color('#3182bd') | ||
.label('waiting', { | ||
style: { | ||
fill: '#f00', | ||
}, | ||
}) | ||
chart.line() | ||
.position('time*people') | ||
.color('#fdae6b') | ||
.size(3) | ||
.shape('smooth') | ||
.label('waiting', { | ||
style: { | ||
fill: '#0f0', | ||
}, | ||
}) | ||
|
||
|
||
chart.render(); | ||
chart.render(); | ||
chart.destroy(); | ||
}) | ||
}) |