@@ -132,15 +132,15 @@ class LegendView extends ComponentView {
132
132
selectorPosition = orient === 'horizontal' ? 'end' : 'start' ;
133
133
}
134
134
135
+ this . renderInner ( itemAlign , legendModel , ecModel , api , selector , orient , selectorPosition ) ;
136
+
135
137
// Perform layout.
136
138
const refContainer = layoutUtil . createBoxLayoutReference ( legendModel , api ) . refContainer ;
137
139
const positionInfo = legendModel . getBoxLayoutParams ( ) ;
138
140
const padding = legendModel . get ( 'padding' ) ;
139
141
140
142
const maxSize = layoutUtil . getLayoutRect ( positionInfo , refContainer , padding ) ;
141
143
142
- this . renderInner ( itemAlign , legendModel , ecModel , api , selector , orient , selectorPosition , maxSize ) ;
143
-
144
144
const mainRect = this . layoutInner ( legendModel , itemAlign , maxSize , isFirstRender , selector , selectorPosition ) ;
145
145
146
146
// Place mainGroup, based on the calculated `mainRect`.
@@ -179,8 +179,7 @@ class LegendView extends ComponentView {
179
179
api : ExtensionAPI ,
180
180
selector : LegendSelectorButtonOption [ ] ,
181
181
orient : LegendOption [ 'orient' ] ,
182
- selectorPosition : LegendOption [ 'selectorPosition' ] ,
183
- maxSize : layoutUtil . LayoutRect ,
182
+ selectorPosition : LegendOption [ 'selectorPosition' ]
184
183
) {
185
184
const contentGroup = this . getContentGroup ( ) ;
186
185
const legendDrawnMap = zrUtil . createHashMap ( ) ;
@@ -228,8 +227,7 @@ class LegendView extends ComponentView {
228
227
const itemGroup = this . _createItem (
229
228
seriesModel , name , dataIndex ,
230
229
legendItemModel , legendModel , itemAlign ,
231
- lineVisualStyle , style , legendIcon , selectMode , api ,
232
- maxSize ,
230
+ lineVisualStyle , style , legendIcon , selectMode , api
233
231
) ;
234
232
235
233
itemGroup . on ( 'click' , curry ( dispatchSelectAction , name , null , api , excludeSeriesId ) )
@@ -284,8 +282,7 @@ class LegendView extends ComponentView {
284
282
const itemGroup = this . _createItem (
285
283
seriesModel , name , dataIndex ,
286
284
legendItemModel , legendModel , itemAlign ,
287
- { } , style , legendIcon , selectMode , api ,
288
- maxSize ,
285
+ { } , style , legendIcon , selectMode , api
289
286
) ;
290
287
291
288
// FIXME: consider different series has items with the same name.
@@ -396,8 +393,7 @@ class LegendView extends ComponentView {
396
393
itemVisualStyle : PathStyleProps ,
397
394
legendIcon : string ,
398
395
selectMode : LegendOption [ 'selectedMode' ] ,
399
- api : ExtensionAPI ,
400
- maxSize : layoutUtil . LayoutRect ,
396
+ api : ExtensionAPI
401
397
) {
402
398
const drawType = seriesModel . visualDrawType ;
403
399
const itemWidth = legendModel . get ( 'itemWidth' ) ;
@@ -479,8 +475,7 @@ class LegendView extends ComponentView {
479
475
y : itemHeight / 2 ,
480
476
fill : textColor ,
481
477
align : textAlign ,
482
- verticalAlign : 'middle' ,
483
- width : maxSize . width - textX ,
478
+ verticalAlign : 'middle'
484
479
} , { inheritColor : textColor } )
485
480
} ) ) ;
486
481
0 commit comments