You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "nyssance (via GitHub)" <gi...@apache.org> on 2024/06/04 19:30:27 UTC

[I] [Feature] 希望Tooltip的valueformatter能够判断是哪个值 [echarts]

nyssance opened a new issue, #20000:
URL: https://github.com/apache/echarts/issues/20000

   ### What problem does this feature solve?
   
   假定我在tooltip上显示一些信息,那么价格是不要百分号的,幅度是需要百分号的,现在提供的很鸡肋。如果我条目少,我自己的写formatter就好了,我现在条目很多,但是又不能针对某一条去定制。现有的只考虑了不同系列的情况,某认一个系列就一个value.事实上,某个系列里面有十几项数据,xy轴之外,tooltip显示剩余的信息,才是tooltip的作用。
   另外现有的valueformatter,数字格式化会加逗号,但是我自己value一下,这个逗号又没了,等于完全自己重做。还不如自己去写formatter,其实主要就是个对齐的功能。
   或者就是加一个全局的百分号类型的解决方案,标注了这项是百分号形式,不管是y轴还是tooltip自动显示百分号。
   
   ### What does the proposed API look like?
   
   (value: number | string, dataIndex: number, params) => string
   


-- 
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.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


Re: [I] [Feature] 希望Tooltip的valueformatter能够判断是哪个值 [echarts]

Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #20000:
URL: https://github.com/apache/echarts/issues/20000#issuecomment-2148596753

   _dataIndex_ has been added already, but is not documented yet. See duplicate #18997 with fix.
   So this is working: ```valueFormatter: function (value, dataIndex)```
   📌 please close issue if problem solved.


-- 
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


Re: [I] [Feature] 希望Tooltip的valueformatter能够判断是哪个值 [echarts]

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] closed issue #20000: [Feature] 希望Tooltip的valueformatter能够判断是哪个值
URL: https://github.com/apache/echarts/issues/20000


-- 
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


Re: [I] [Feature] 希望Tooltip的valueformatter能够判断是哪个值 [echarts]

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on issue #20000:
URL: https://github.com/apache/echarts/issues/20000#issuecomment-2148252002

   @nyssance It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Feature] I hope the valueformatter of Tooltip can determine which value it is.
   
   **BODY**
   
   ### What problem does this feature solve?
   
   Suppose I display some information on the tooltip, then the price is not a percent sign, the amplitude needs a percent sign, and the current provision is very frustrating. If I have few entries, I can write my own formatter, I have a lot of entries now, but I can't customize it for one or the other. In fact, there are more than a dozen items of data in a series, and tooltip displays the remaining information outside the xy axis, which is the role of tooltip.
   In addition, the existing valueformatter, the number formatting will add a comma, but I value it myself, and this comma is gone, which is equivalent to completely redoing it myself. It's better to write the formatter yourself, in fact, it's mainly an alignment function.
   Or just add a global percent type solution, which indicates that this item is in the form of a percent sign, whether it is the y axis or the tooltip automatically displays the percent sign.
   
   ### What does the proposed API look like?
   
   (value: number | string, dataIndex: number, params) => string
   </details>


-- 
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


Re: [I] [Feature] 希望Tooltip的valueformatter能够判断是哪个值 [echarts]

Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart commented on issue #20000:
URL: https://github.com/apache/echarts/issues/20000#issuecomment-2155888868

   The `dataIndex` callback parameter has been provided since v5.5.0 and can be found at: https://echarts.apache.org/option.html#tooltip.valueFormatter.


-- 
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