@@ -613,19 +613,6 @@ axes.calcTicks = function calcTicks(ax, opts) {
613
613
var minRange = Math . min ( rng [ 0 ] , rng [ 1 ] ) ;
614
614
var maxRange = Math . max ( rng [ 0 ] , rng [ 1 ] ) ;
615
615
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
-
629
616
var isDLog = ( ax . type === 'log' ) && ! ( isNumeric ( ax . dtick ) || ax . dtick . charAt ( 0 ) === 'L' ) ;
630
617
var isMDate = ( ax . type === 'date' ) && ! ( isNumeric ( ax . dtick ) || ax . dtick . charAt ( 0 ) === 'M' ) ;
631
618
@@ -708,6 +695,19 @@ axes.calcTicks = function calcTicks(ax, opts) {
708
695
}
709
696
}
710
697
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
+
711
711
var x = ax . _tmin ;
712
712
713
713
if ( ax . rangebreaks && ax . _tick0Init !== ax . tick0 ) {
0 commit comments