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) {
163
163
// draw the remaining pieces below
164
164
if ( expMargin ) return ;
165
165
166
+ var lx , ly ;
167
+
166
168
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 ;
168
170
} else {
169
171
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 ;
171
173
}
172
174
173
175
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 ;
175
177
} else {
176
178
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 ;
178
180
}
179
181
180
182
// TODO: Does this also apply if y/xref=container?
Original file line number Diff line number Diff line change 54
54
"layout" :{
55
55
"showlegend" :true ,
56
56
"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"
66
60
}
67
61
}
68
62
}
You can’t perform that action at this time.
0 commit comments