tinysimple opened a new issue, #21459:
URL: https://github.com/apache/echarts/issues/21459
### What problem does this feature solve?
Multiple line segments in a line chart cannot be assigned different
numerical units to different line charts using the `tooltip.valueFormatter`
function. At present, the `valueFormatter` function only has two parameters,
`name` and `dataIndex`.
Since it is just a simple requirement, I do not want to rewrite the entire
content and style through `tooltip.formatter` (I do not want to change the
default style).
Upon checking the source code, it was found that the relevant code is
located at line `351` in the file `src/component/tooltip/tooltipMarkup.ts`.
Through breakpoint debugging, I found that the name in the fragment object is
the line segment name in the series. I need this name field to determine what
units should be displayed.
For example:
Add unit A to the current line
Add unit V to the voltage line
### What does the proposed API look like?
Original codeļ¼
`const readableValueList = noValue
? []
: valueFormatter(fragment.value as OptionDataValue,
fragment.dataIndex);`
new code:
`const readableValueList = noValue
? []
: valueFormatter(fragment.value as OptionDataValue,
fragment.dataIndex, fragment.name);`
or
`const readableValueList = noValue
? []
: valueFormatter(fragment.value as OptionDataValue,
fragment.dataIndex, fragment);`
--
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]