-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathissue-408-spec.js
40 lines (34 loc) · 900 Bytes
/
issue-408-spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const expect = require('chai').expect;
const G2 = require('../../src/index');
describe('#408', () => {
it('NaN', () => {
const div = document.createElement('div');
document.body.appendChild(div);
const data = [
{ genre: 'Sports', sold: NaN }
];
const chart = new G2.Chart({
container: div,
width: 540,
height: 540,
animate: false
});
chart.source(data, {
});
chart.legend({
position: 'right'
});
chart.interval()
.position('genre*sold').color('sold');
chart.render();
expect(chart.getYScales()[0].min).equal(0);
expect(chart.getYScales()[0].max).equal(1);
const data1 = [
{ genre: 'Sports', sold: NaN },
{ genre: 'Other', sold: 100 }
];
chart.changeData(data1);
expect(chart.getYScales()[0].min).equal(0);
expect(chart.getYScales()[0].max).equal(100);
});
});