-
Notifications
You must be signed in to change notification settings - Fork 19.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: nameFormatter and headerFormatter added #16942
base: next
Are you sure you want to change the base?
Conversation
Thanks for your contribution! Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the |
There is a replacement: #16703 (comment) |
Any plans on merging this? nameFormatter would be really useful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature looks great! Please also provide a test case using npm mktest xxx
.
valueFormatter: CommonTooltipOption<unknown>['valueFormatter'] | ||
valueFormatter: CommonTooltipOption<unknown>['valueFormatter']; | ||
nameFormatter?: CommonTooltipOption<unknown>['nameFormatter']; | ||
headerFormatter?: CommonTooltipOption<unknown>['headerFormatter'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing ;
Brief Information
This pull request is in the type of:
What does this PR do?
New APIs
tooltip.nameFormatter
andtooltip.headerFormatter
that allow user to change name and header respectively in tooltip are added.Fixed issues
Details
Before: What was the problem?
"New formatter" like
tooltip.valueFormatter
is requested to change the name and header in tooltip. With these formatters users can change only the series name or the header (x-axis value), without changing the other default parts of the tooltip.Users cannot change the format of date and have to display the exact time despite they don't need it.
After: How is it fixed in this PR?
New APIs
tooltip.nameFormatter
andtooltip.headerFormatter
are added. They allow user to change name and header respectively in tooltip without changing other default part.After setting
tooltip
to:We have
User can change name and header as wish without having to write the whole thing from scratch with
tooltip.formatter
.Misc
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information