diff --git a/src/component/tooltip/TooltipView.ts b/src/component/tooltip/TooltipView.ts index d5bf5d8f21..63d879b9e8 100644 --- a/src/component/tooltip/TooltipView.ts +++ b/src/component/tooltip/TooltipView.ts @@ -681,6 +681,7 @@ class TooltipView extends ComponentView { params.marker = markupStyleCreator.makeTooltipMarker( 'item', convertToColorString(params.color), renderMode ); + params.dimensionIndex = dispatcher.__dimIdx; const seriesTooltipResult = normalizeTooltipFormatResult( dataModel.formatTooltip(dataIndex, false, dataType) diff --git a/src/core/echarts.ts b/src/core/echarts.ts index 190e385634..44a8ea2cfb 100644 --- a/src/core/echarts.ts +++ b/src/core/echarts.ts @@ -1067,14 +1067,15 @@ class ECharts extends Eventful { const handler = (e: ElementEvent) => { const ecModel = this.getModel(); const el = e.target; + let dispatcher: ECElement | undefined; let params: ECElementEvent; const isGlobalOut = eveName === 'globalout'; // no e.target when 'globalout'. if (isGlobalOut) { params = {} as ECElementEvent; } - else { - el && findEventDispatcher(el, (parent) => { + else if (el) { + dispatcher = findEventDispatcher(el, (parent) => { const ecData = getECData(parent); if (ecData && ecData.dataIndex != null) { const dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex); @@ -1131,6 +1132,7 @@ class ECharts extends Eventful { params.event = e; params.type = eveName; + params.dimensionIndex = dispatcher ? dispatcher.__dimIdx : undefined; (this._$eventProcessor as ECEventProcessor).eventInfo = { targetEl: el, diff --git a/src/util/types.ts b/src/util/types.ts index 1d085c198f..a1ae9d582b 100644 --- a/src/util/types.ts +++ b/src/util/types.ts @@ -137,6 +137,11 @@ export interface ECElement extends Element { * Force disable morphing */ disableMorphing?: boolean + + /** + * From RadarSymbol + */ + __dimIdx?: number; } export interface DataHost {