File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -163,18 +163,20 @@ function drawOne(gd, opts) {
163163 // draw the remaining pieces below
164164 if ( expMargin ) return ;
165165
166+ var lx , ly ;
167+
166168 if ( legendObj . xref === 'paper' ) {
167- var lx = gs . l + gs . w * legendObj . x - FROM_TL [ getXanchor ( legendObj ) ] * legendObj . _width ;
169+ lx = gs . l + gs . w * legendObj . x - FROM_TL [ getXanchor ( legendObj ) ] * legendObj . _width ;
168170 } else {
169171 legendObj . x = Lib . constrain ( legendObj . x , 0 , 1 ) ; // TODO: Move this to defaults setting?
170- var lx = fullLayout . width * legendObj . x - FROM_TL [ getXanchor ( legendObj ) ] * legendObj . _width ;
172+ lx = fullLayout . width * legendObj . x - FROM_TL [ getXanchor ( legendObj ) ] * legendObj . _width ;
171173 }
172174
173175 if ( legendObj . yref === 'paper' ) {
174- var ly = gs . t + gs . h * ( 1 - legendObj . y ) - FROM_TL [ getYanchor ( legendObj ) ] * legendObj . _effHeight ;
176+ ly = gs . t + gs . h * ( 1 - legendObj . y ) - FROM_TL [ getYanchor ( legendObj ) ] * legendObj . _effHeight ;
175177 } else {
176178 legendObj . y = Lib . constrain ( legendObj . y , 0 , 1 ) ; // TODO: Move this to defaults setting?
177- var ly = fullLayout . height * ( 1 - legendObj . y ) - FROM_TL [ getYanchor ( legendObj ) ] * legendObj . _effHeight ;
179+ ly = fullLayout . height * ( 1 - legendObj . y ) - FROM_TL [ getYanchor ( legendObj ) ] * legendObj . _effHeight ;
178180 }
179181
180182 // TODO: Does this also apply if y/xref=container?
Original file line number Diff line number Diff line change 5454 "layout" :{
5555 "showlegend" :true ,
5656 "legend" :{
57- "x" : 0 ,
58- "y" : 0 ,
59- "xref" : " container" ,
60- "yref" : " container" ,
61- "orientation" : " h"
62- },
63- "margin" : {
64- "t" : 75 ,
65- "r" : 115
57+ "x" :1 ,
58+ "y" :1 ,
59+ "xanchor" :" left"
6660 }
6761 }
6862}
You can’t perform that action at this time.
0 commit comments