@@ -11,7 +11,7 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer
1111 var letter = options . letter ;
1212 var grid = options . grid ;
1313 var overlayingDomain = options . overlayingDomain ;
14- var dfltAnchor , dfltDomain , dfltSide , dfltPosition , dfltAutoshift , dfltShift , dfltAutomargin ;
14+ var dfltAnchor , dfltDomain , dfltSide , dfltPosition , dfltShift , dfltAutomargin ;
1515
1616 if ( grid ) {
1717 dfltDomain = grid . _domains [ letter ] [ grid . _axisMap [ containerOut . _id ] ] ;
@@ -27,9 +27,8 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer
2727 dfltAnchor = dfltAnchor || ( isNumeric ( containerIn . position ) ? 'free' : ( counterAxes [ 0 ] || 'free' ) ) ;
2828 dfltSide = dfltSide || ( letter === 'x' ? 'bottom' : 'left' ) ;
2929 dfltPosition = dfltPosition || 0 ;
30- dfltAutoshift = dfltAutoshift || false ;
31- dfltShift = dfltShift || 0 ;
32- dfltAutomargin = dfltAutomargin || false ;
30+ dfltShift = 0 ;
31+ dfltAutomargin = false ;
3332
3433 var anchor = Lib . coerce ( containerIn , containerOut , {
3534 anchor : {
@@ -48,14 +47,16 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer
4847 } , 'side' ) ;
4948
5049 if ( anchor === 'free' ) {
51- var autoshift = coerce ( 'autoshift' , dfltAutoshift ) ;
52- if ( autoshift === true ) {
53- dfltPosition = side === 'left' ? overlayingDomain [ 0 ] : overlayingDomain [ 1 ] ;
54- dfltAutomargin = containerOut . automargin ? containerOut . automargin : true ;
55- dfltShift = side === 'left' ? - 3 : 3 ;
50+ if ( letter === 'y' ) {
51+ var autoshift = coerce ( 'autoshift' ) ;
52+ if ( autoshift === true ) {
53+ dfltPosition = side === 'left' ? overlayingDomain [ 0 ] : overlayingDomain [ 1 ] ;
54+ dfltAutomargin = containerOut . automargin ? containerOut . automargin : true ;
55+ dfltShift = side === 'left' ? - 3 : 3 ;
56+ }
57+ coerce ( 'shift' , dfltShift ) ;
5658 }
5759 coerce ( 'position' , dfltPosition ) ;
58- coerce ( 'shift' , dfltShift ) ;
5960 }
6061 coerce ( 'automargin' , dfltAutomargin ) ;
6162
0 commit comments