plainheart commented on issue #21477:
URL: https://github.com/apache/echarts/issues/21477#issuecomment-3754466707

   A possible quick fix may be to add the raw absolute dataIndex `rawDataIndex` 
and take it as the callback parameter of `valueFormatter`.
   
   
https://github.com/apache/echarts/blob/09198192bbb1e274beb408c650c515f8e3a057a5/src/component/tooltip/seriesFormatTooltip.ts#L89-L97
   
   
   ```diff
   return createTooltipMarkup('section', { 
       header: seriesName, 
       // When series name is not specified, do not show a header line with 
only '-'. 
       // This case always happens in tooltip.trigger: 'item'. 
       noHeader: multipleSeries || !seriesNameSpecified, 
       sortParam: sortParam, 
       blocks: [ 
           createTooltipMarkup('nameValue', { 
               markerType: 'item', 
               markerColor: markerColor, 
               // Do not mix display seriesName and itemName in one tooltip, 
               // which might confuses users. 
               name: inlineName, 
               // name dimension might be auto assigned, where the name might 
               // be not readable. So we check trim here. 
               noName: !trim(inlineName), 
               value: inlineValue, 
               valueType: inlineValueType, 
   -           dataIndex
   +           dataIndex,
   +           rawDataIndex: data.getRawIndex(dataIndex)
           }) 
       ].concat(subBlocks || [] as any) 
   });
   ```
   
   
https://github.com/apache/echarts/blob/09198192bbb1e274beb408c650c515f8e3a057a5/src/component/tooltip/tooltipMarkup.ts#L349-L351
   
   ```diff
   -     : valueFormatter(fragment.value as OptionDataValue, 
fragment.dataIndex); 
   +     : valueFormatter(fragment.value as OptionDataValue, 
fragment.rawDataIndex); 
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to