@@ -613,19 +613,6 @@ axes.calcTicks = function calcTicks(ax, opts) {
613613 var minRange = Math . min ( rng [ 0 ] , rng [ 1 ] ) ;
614614 var maxRange = Math . max ( rng [ 0 ] , rng [ 1 ] ) ;
615615
616- // find the first tick
617- ax . _tmin = axes . tickFirst ( ax , opts ) ;
618-
619- // No visible ticks? Quit.
620- // I've only seen this on category axes with all categories off the edge.
621- if ( ( ax . _tmin < startTick ) !== axrev ) return [ ] ;
622-
623- // return the full set of tick vals
624- if ( ax . type === 'category' || ax . type === 'multicategory' ) {
625- endTick = ( axrev ) ? Math . max ( - 0.5 , endTick ) :
626- Math . min ( ax . _categories . length - 0.5 , endTick ) ;
627- }
628-
629616 var isDLog = ( ax . type === 'log' ) && ! ( isNumeric ( ax . dtick ) || ax . dtick . charAt ( 0 ) === 'L' ) ;
630617 var isMDate = ( ax . type === 'date' ) && ! ( isNumeric ( ax . dtick ) || ax . dtick . charAt ( 0 ) === 'M' ) ;
631618
@@ -708,6 +695,19 @@ axes.calcTicks = function calcTicks(ax, opts) {
708695 }
709696 }
710697
698+ // find the first tick
699+ ax . _tmin = axes . tickFirst ( ax , opts ) ;
700+
701+ // No visible ticks? Quit.
702+ // I've only seen this on category axes with all categories off the edge.
703+ if ( ( ax . _tmin < startTick ) !== axrev ) return [ ] ;
704+
705+ // return the full set of tick vals
706+ if ( ax . type === 'category' || ax . type === 'multicategory' ) {
707+ endTick = ( axrev ) ? Math . max ( - 0.5 , endTick ) :
708+ Math . min ( ax . _categories . length - 0.5 , endTick ) ;
709+ }
710+
711711 var x = ax . _tmin ;
712712
713713 if ( ax . rangebreaks && ax . _tick0Init !== ax . tick0 ) {
0 commit comments