@@ -543,15 +543,28 @@ function autoShiftMonthBins(binStart, data, dtick, dataMin, calendar) {
543543// ensure we have minor tick0 and dtick calculated
544544axes . prepMinorTicks = function ( ax ) {
545545 var majorDtick = ax . _majorDtick ;
546- var dist = majorDtick ;
547-
548- if ( ax . type === 'date' && typeof majorDtick === 'string' && majorDtick . charAt ( 0 ) === 'M' ) {
549- var months = Number ( majorDtick . substring ( 1 ) ) ;
550- dist = months * ONEAVGMONTH ;
551- }
552-
553546 if ( ax . tickmode === 'auto' || ! ax . dtick ) {
554- axes . autoTicks ( ax , dist / 7 , 'minor' ) ;
547+ var dist = majorDtick ;
548+
549+ if ( ax . type === 'date' && typeof majorDtick === 'string' && majorDtick . charAt ( 0 ) === 'M' ) {
550+ var months = Number ( majorDtick . substring ( 1 ) ) ;
551+ dist = months * ONEAVGMONTH / 7 ;
552+ } else if ( ax . type === 'log' ) {
553+ if ( typeof majorDtick === 'string' && majorDtick . charAt ( 0 ) === 'L' ) {
554+ ax . dtick = 'L' + ( majorDtick . substring ( 1 ) / 2 ) ;
555+ return ;
556+ } else if ( dist === 'D1' ) {
557+ dist = 1 ;
558+ } else if ( dist === 'D2' ) {
559+ dist = 'D1' ;
560+ } else {
561+ dist /= 2 ;
562+ }
563+ } else {
564+ dist /= 7 ;
565+ }
566+
567+ axes . autoTicks ( ax , dist , 'minor' ) ;
555568 }
556569} ;
557570
@@ -1294,7 +1307,7 @@ axes.autoTicks = function(ax, roughDTick, isMinor) {
12941307
12951308 if ( roughDTick > 0.7 ) {
12961309 // only show powers of 10
1297- ax . dtick = Math . ceil ( roughDTick ) ;
1310+ ax . dtick = isMinor ? 1 : Math . ceil ( roughDTick ) ;
12981311 } else if ( Math . abs ( rng [ 1 ] - rng [ 0 ] ) < 1 ) {
12991312 // span is less than one power of 10
13001313 var nt = 1.5 * Math . abs ( ( rng [ 1 ] - rng [ 0 ] ) / roughDTick ) ;
0 commit comments