Skip to content

Commit 94c4560

Browse files
committed
fix #2004
(or more precisely test that it was already fixed)
1 parent 4c46a73 commit 94c4560

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/jasmine/tests/finance_test.js

+14
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,20 @@ describe('finance charts calc', function() {
613613
expect(out[1][0].t.wHover).toBe(out[0][0].t.wHover);
614614
});
615615

616+
it('works with category x data', function() {
617+
// see https://github.com/plotly/plotly.js/issues/2004
618+
// fixed automatically as part of the refactor to a non-transform trace
619+
var trace0 = Lib.extendDeep({}, mock0, {
620+
type: 'ohlc',
621+
x: ['a', 'b', 'c', 'd', 'e']
622+
});
623+
624+
var out = _calcRaw([trace0]);
625+
626+
expect(out[0][0].t.tickLen).toBeCloseTo(0.3, 5);
627+
expect(out[0][0].t.wHover).toBeCloseTo(0.5, 5);
628+
});
629+
616630
it('should fallback to a spacing of 1 in one-item traces', function() {
617631
var trace0 = Lib.extendDeep({}, mock0, {
618632
type: 'ohlc',

0 commit comments

Comments
 (0)