File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ function buildNameValue(
324324 const noMarker = ! fragment . markerType ;
325325 const name = fragment . name ;
326326 const useUTC = ctx . useUTC ;
327- const valueFormatter = fragment . valueFormatter || ctx . valueFormatter || ( ( value ) => {
327+ const valueFormatter = fragment . valueFormatter || ctx . valueFormatter || ( ( value , dataIndex , name ) => { // Added params here
328328 value = isArray ( value ) ? value : [ value ] ;
329329 return map ( value as unknown [ ] , ( val , idx ) => makeValueReadable (
330330 val , isArray ( valueTypeOption ) ? valueTypeOption [ idx ] : valueTypeOption , useUTC
@@ -347,8 +347,8 @@ function buildNameValue(
347347 : makeValueReadable ( name , 'ordinal' , useUTC ) ;
348348 const valueTypeOption = fragment . valueType ;
349349 const readableValueList = noValue
350- ? [ ]
351- : valueFormatter ( fragment . value as OptionDataValue , fragment . dataIndex ) ;
350+ ? [ ]
351+ : valueFormatter ( fragment . value as OptionDataValue , fragment . dataIndex , fragment . name ) ; // Added fragment.name
352352 const valueAlignRight = ! noMarker || ! noName ;
353353 // It little weird if only value next to marker but far from marker.
354354 const valueCloseToMarker = ! noMarker && noName ;
Original file line number Diff line number Diff line change @@ -1540,11 +1540,11 @@ export interface CommonTooltipOption<FormatterParams> {
15401540 formatter ?: string | TooltipFormatterCallback < FormatterParams >
15411541
15421542 /**
1543- * Formatter of value.
1544- *
1545- * Will be ignored if tooltip.formatter is specified.
1546- */
1547- valueFormatter ?: ( value : OptionDataValue | OptionDataValue [ ] , dataIndex : number ) => string
1543+ * Formatter of value.
1544+ *
1545+ * Will be ignored if tooltip.formatter is specified.
1546+ */
1547+ valueFormatter ?: ( value : OptionDataValue | OptionDataValue [ ] , dataIndex : number , name ?: string ) => string | string [ ]
15481548 /**
15491549 * Absolution pixel [x, y] array. Or relative percent string [x, y] array.
15501550 * If trigger is 'item'. position can be set to 'inside' / 'top' / 'left' / 'right' / 'bottom',
You can’t perform that action at this time.
0 commit comments