@@ -206,9 +206,11 @@ function makePadFn(ax, max) {
206
206
// 5% padding for points that specify extrapad: true
207
207
var extrappad = 0.05 * ax . _length ;
208
208
209
+ var anchorAxis = ax . _anchorAxis || { } ;
210
+
209
211
if (
210
212
( ax . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ||
211
- ( ( ax . _anchorAxis || { } ) . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1
213
+ ( anchorAxis . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1
212
214
) {
213
215
var axReverse = ax . autorange === 'reversed' ;
214
216
if ( ! axReverse ) {
@@ -218,8 +220,16 @@ function makePadFn(ax, max) {
218
220
if ( axReverse ) max = ! max ;
219
221
}
220
222
221
- var A = padInsideLabelsOnAnchorAxis ( ax , max ) ;
222
- var B = padInsideLabelsOnThisAxis ( ax , max ) ;
223
+ var A = 0 ;
224
+ var B = 0 ;
225
+
226
+ if (
227
+ ! anchorAxis . matches && ! ax . matches &&
228
+ ! anchorAxis . scaleanchor && ! ax . scaleanchor
229
+ ) {
230
+ A = padInsideLabelsOnAnchorAxis ( ax , max ) ;
231
+ B = padInsideLabelsOnThisAxis ( ax , max ) ;
232
+ }
223
233
224
234
var zero = Math . max ( A , B ) ;
225
235
extrappad = Math . max ( zero , extrappad ) ;
@@ -273,7 +283,7 @@ function padInsideLabelsOnThisAxis(ax, max) {
273
283
274
284
function padInsideLabelsOnAnchorAxis ( ax , max ) {
275
285
var pad = 0 ;
276
- var anchorAxis = ( ax . _anchorAxis || { } ) ;
286
+ var anchorAxis = ax . _anchorAxis || { } ;
277
287
if ( ( anchorAxis . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ) {
278
288
// increase padding to make more room for inside tick labels of the counter axis
279
289
if ( (
0 commit comments