* Map tooltip formatter
(
dataIndex: number,
multipleSeries: boolean,
dataType: string
)
| 218 | * Map tooltip formatter |
| 219 | */ |
| 220 | formatTooltip( |
| 221 | dataIndex: number, |
| 222 | multipleSeries: boolean, |
| 223 | dataType: string |
| 224 | ) { |
| 225 | // FIXME originalData and data is a bit confusing |
| 226 | const data = this.getData(); |
| 227 | const value = this.getRawValue(dataIndex); |
| 228 | const name = data.getName(dataIndex); |
| 229 | |
| 230 | const seriesNames: string[] = []; |
| 231 | zrUtil.each(this.seriesGroup.f, function (mapSeries) { |
| 232 | const otherIndex = mapSeries.originalData.indexOfName(name); |
| 233 | const valueDim = data.mapDimension('value'); |
| 234 | if (!isNaN(mapSeries.originalData.get(valueDim, otherIndex) as number)) { |
| 235 | seriesNames.push(mapSeries.name); |
| 236 | } |
| 237 | }); |
| 238 | |
| 239 | return createTooltipMarkup('section', { |
| 240 | header: seriesNames.join(', '), |
| 241 | noHeader: !seriesNames.length, |
| 242 | blocks: [createTooltipMarkup('nameValue', { |
| 243 | name: name, value: value |
| 244 | })] |
| 245 | }); |
| 246 | } |
| 247 | |
| 248 | getTooltipPosition = function (this: MapSeries, dataIndex: number): number[] { |
| 249 | if (dataIndex != null) { |
no test coverage detected