Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3fbb460

Browse files
committed
ensure empty candlestick trace don't lead to autotyped 'category' x-axis
- box traces have a special algo to handle the case where trace 'name' can appear on axis ticks.
1 parent 87b12cf commit 3fbb460

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/plots/cartesian/axis_defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ function isBoxWithoutPositionCoords(trace, axLetter) {
207207

208208
return (
209209
Registry.traceIs(trace, 'box') &&
210+
trace._fullInput.type === 'box' &&
210211
axLetter === posLetter &&
211212
trace[posLetter] === undefined &&
212213
trace[posLetter + '0'] === undefined

test/jasmine/tests/finance_test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,13 @@ describe('finance charts defaults:', function() {
367367
expect(fullTrace.xcalendar).toBe(i < 2 ? 'hebrew' : 'julian');
368368
});
369369
});
370+
371+
it('should make empty candlestick traces autotype to *linear* (as opposed to real box traces)', function() {
372+
var trace0 = { type: 'candlestick' };
373+
var out = _supply([trace0], { xaxis: {} });
374+
375+
expect(out._fullLayout.xaxis.type).toEqual('linear');
376+
});
370377
});
371378

372379
describe('finance charts calc transforms:', function() {

0 commit comments

Comments
 (0)