@@ -543,15 +543,28 @@ function autoShiftMonthBins(binStart, data, dtick, dataMin, calendar) {
543
543
// ensure we have minor tick0 and dtick calculated
544
544
axes . prepMinorTicks = function ( ax ) {
545
545
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
-
553
546
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' ) ;
555
568
}
556
569
} ;
557
570
@@ -1294,7 +1307,7 @@ axes.autoTicks = function(ax, roughDTick, isMinor) {
1294
1307
1295
1308
if ( roughDTick > 0.7 ) {
1296
1309
// only show powers of 10
1297
- ax . dtick = Math . ceil ( roughDTick ) ;
1310
+ ax . dtick = isMinor ? 1 : Math . ceil ( roughDTick ) ;
1298
1311
} else if ( Math . abs ( rng [ 1 ] - rng [ 0 ] ) < 1 ) {
1299
1312
// span is less than one power of 10
1300
1313
var nt = 1.5 * Math . abs ( ( rng [ 1 ] - rng [ 0 ] ) / roughDTick ) ;
0 commit comments