diff --git a/src/component/tooltip/seriesFormatTooltip.ts b/src/component/tooltip/seriesFormatTooltip.ts index 714cac2dfd..88182fde06 100644 --- a/src/component/tooltip/seriesFormatTooltip.ts +++ b/src/component/tooltip/seriesFormatTooltip.ts @@ -94,7 +94,7 @@ export function defaultSeriesFormatTooltip(opt: { noName: !trim(inlineName), value: inlineValue, valueType: inlineValueType, - dataIndex + rawDataIndex: data.getRawIndex(dataIndex), }) ].concat(subBlocks || [] as any) }); diff --git a/src/component/tooltip/tooltipMarkup.ts b/src/component/tooltip/tooltipMarkup.ts index b51fe55ca9..2524f753de 100644 --- a/src/component/tooltip/tooltipMarkup.ts +++ b/src/component/tooltip/tooltipMarkup.ts @@ -174,7 +174,7 @@ export interface TooltipMarkupNameValueBlock extends TooltipMarkupBlock { // null/undefined/NaN/''... (displayed as '-'). noName?: boolean; noValue?: boolean; - dataIndex?: number; + rawDataIndex?: number; valueFormatter?: CommonTooltipOption['valueFormatter'] } @@ -348,7 +348,7 @@ function buildNameValue( const valueTypeOption = fragment.valueType; const readableValueList = noValue ? [] - : valueFormatter(fragment.value as OptionDataValue, fragment.dataIndex); + : valueFormatter(fragment.value as OptionDataValue, fragment.rawDataIndex); const valueAlignRight = !noMarker || !noName; // It little weird if only value next to marker but far from marker. const valueCloseToMarker = !noMarker && noName; diff --git a/test/tooltip-valueFormatter.html b/test/tooltip-valueFormatter.html index 3d48e8e975..0101780d38 100644 --- a/test/tooltip-valueFormatter.html +++ b/test/tooltip-valueFormatter.html @@ -271,35 +271,51 @@