You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/01/06 12:39:40 UTC
[GitHub] [echarts] pissang commented on pull request #16332: add valueFormatter in tooltip
pissang commented on pull request #16332:
URL: https://github.com/apache/echarts/pull/16332#issuecomment-1006554469
@plainheart Because formatter is for the whole tooltip. It returns one HTML string for the tooltip. And `valueFormatter` will be called for each value. It's also returns one string after formatted. It's more consistent and easier for developer to process.
If we return an array. Developers need to check if value is array and loop them to process each one. And they may be confused if they should return an array or a combined string.
There are cases that different series need to have different formatted result. The `series.tooltip.formatter` metioned in the description exists for this situation. We can also add a second param that includes `seriesIndex`, `dataIndex` for more information. It's like callback in `xAxis.axisLabel.formatter`. But I prefer to keep it simple at first.
--
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: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org