Skip to content

Commit 6f0a95d

Browse files
committed
add non-numeric 'x' items test for bar calc.js
1 parent 042cc82 commit 6f0a95d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/jasmine/tests/bar_test.js

+11
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,17 @@ describe('Bar.calc', function() {
305305
assertPointField(cd, 'x', [[0, 1, 2, 3]]);
306306
assertPointField(cd, 'y', [[1, NaN, NaN, 15]]);
307307
});
308+
309+
it('should not exclude items with non-numeric x from calcdata (to plots gaps correctly)', function() {
310+
var gd = mockBarPlot([{
311+
x: [1, null, 'nonsense', 15],
312+
y: [1, 2, 10, 30]
313+
}]);
314+
315+
var cd = gd.calcdata;
316+
assertPointField(cd, 'x', [[1, NaN, NaN, 15]]);
317+
assertPointField(cd, 'y', [[1, 2, 10, 30]]);
318+
});
308319
});
309320

310321
describe('Bar.setPositions', function() {

0 commit comments

Comments
 (0)