(
itemAlign: LegendOption['align'],
legendModel: LegendModel,
ecModel: GlobalModel,
api: ExtensionAPI,
selector: LegendSelectorButtonOption[],
orient: LegendOption['orient'],
selectorPosition: LegendOption['selectorPosition']
)
| 172 | } |
| 173 | |
| 174 | protected renderInner( |
| 175 | itemAlign: LegendOption['align'], |
| 176 | legendModel: LegendModel, |
| 177 | ecModel: GlobalModel, |
| 178 | api: ExtensionAPI, |
| 179 | selector: LegendSelectorButtonOption[], |
| 180 | orient: LegendOption['orient'], |
| 181 | selectorPosition: LegendOption['selectorPosition'] |
| 182 | ) { |
| 183 | const contentGroup = this.getContentGroup(); |
| 184 | const legendDrawnMap = zrUtil.createHashMap(); |
| 185 | const selectMode = legendModel.get('selectedMode'); |
| 186 | const triggerEvent = legendModel.get('triggerEvent'); |
| 187 | |
| 188 | const excludeSeriesId: string[] = []; |
| 189 | ecModel.eachRawSeries(function (seriesModel) { |
| 190 | !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id); |
| 191 | }); |
| 192 | |
| 193 | each(legendModel.getData(), function (legendItemModel, dataIndex) { |
| 194 | const name = legendItemModel.get('name'); |
| 195 | |
| 196 | // Use empty string or \n as a newline string |
| 197 | if (!this.newlineDisabled && (name === '' || name === '\n')) { |
| 198 | const g = new Group(); |
| 199 | // @ts-ignore |
| 200 | g.newline = true; |
| 201 | contentGroup.add(g); |
| 202 | return; |
| 203 | } |
| 204 | |
| 205 | // Representitive series. |
| 206 | const seriesModel = ecModel.getSeriesByName(name)[0] as |
| 207 | SeriesModel<SeriesOption & SymbolOptionMixin>; |
| 208 | |
| 209 | if (legendDrawnMap.get(name)) { |
| 210 | // Have been drawn |
| 211 | return; |
| 212 | } |
| 213 | |
| 214 | // Legend to control series. |
| 215 | if (seriesModel) { |
| 216 | const data = seriesModel.getData(); |
| 217 | const lineVisualStyle = data.getVisual('legendLineStyle') || {}; |
| 218 | const legendIcon = data.getVisual('legendIcon'); |
| 219 | |
| 220 | /** |
| 221 | * `data.getVisual('style')` may be the color from the register |
| 222 | * in series. For example, for line series, |
| 223 | */ |
| 224 | const style = data.getVisual('style'); |
| 225 | |
| 226 | const itemGroup = this._createItem( |
| 227 | seriesModel, name, dataIndex, |
| 228 | legendItemModel, legendModel, itemAlign, |
| 229 | lineVisualStyle, style, legendIcon, selectMode, api |
| 230 | ); |
| 231 |
no test coverage detected