diff --git a/src/plots/cartesian/axis_defaults.js b/src/plots/cartesian/axis_defaults.js index 21fbe0585cd..e4e99bf8294 100644 --- a/src/plots/cartesian/axis_defaults.js +++ b/src/plots/cartesian/axis_defaults.js @@ -203,10 +203,13 @@ function getBoxPosLetter(trace) { } function isBoxWithoutPositionCoords(trace, axLetter) { - var posLetter = getBoxPosLetter(trace); + var posLetter = getBoxPosLetter(trace), + isBox = Registry.traceIs(trace, 'box'), + isCandlestick = Registry.traceIs(trace._fullInput || {}, 'candlestick'); return ( - Registry.traceIs(trace, 'box') && + isBox && + !isCandlestick && axLetter === posLetter && trace[posLetter] === undefined && trace[posLetter + '0'] === undefined diff --git a/src/traces/candlestick/index.js b/src/traces/candlestick/index.js index e0203edb797..13764ecbabe 100644 --- a/src/traces/candlestick/index.js +++ b/src/traces/candlestick/index.js @@ -15,7 +15,7 @@ module.exports = { moduleType: 'trace', name: 'candlestick', basePlotModule: require('../../plots/cartesian'), - categories: ['cartesian', 'showLegend'], + categories: ['cartesian', 'showLegend', 'candlestick'], meta: { description: [ 'The candlestick is a style of financial chart describing', diff --git a/test/jasmine/tests/finance_test.js b/test/jasmine/tests/finance_test.js index 608a33aea4b..ef217bb9c0e 100644 --- a/test/jasmine/tests/finance_test.js +++ b/test/jasmine/tests/finance_test.js @@ -367,6 +367,13 @@ describe('finance charts defaults:', function() { expect(fullTrace.xcalendar).toBe(i < 2 ? 'hebrew' : 'julian'); }); }); + + it('should make empty candlestick traces autotype to *linear* (as opposed to real box traces)', function() { + var trace0 = { type: 'candlestick' }; + var out = _supply([trace0], { xaxis: {} }); + + expect(out._fullLayout.xaxis.type).toEqual('linear'); + }); }); describe('finance charts calc transforms:', function() {