You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "li-jia-nan (via GitHub)" <gi...@apache.org> on 2024/12/11 18:33:42 UTC
[I] [Feature] I hope to get all series information when tooltip.trigger = item [echarts]
li-jia-nan opened a new issue, #20579:
URL: https://github.com/apache/echarts/issues/20579
### What problem does this feature solve?
`tooltip.formatter` 方法接受一个 `params` 参数,当 `tooltip.trigger = item` 的,`params` 是当前 hover 的 series data,当 `tooltip.trigger = axis` 时,`params` 是一个数组,包含所有的 series data
我需要在 `tooltip.trigger = item` 的时候,在 tooltip 中也展示所有的 series 信息,所以我希望 `tooltip.trigger = item` 的,也可以获取到所有的 series data
---
The `tooltip.formatter` method accepts a params. When `tooltip.trigger = item`, `params` is the series data of the current hover. When `tooltip.trigger = axis`, `params` is an array containing all series data.
I need to display all series info in the tooltip when `tooltip.trigger = item`, so I hope to get all series data when `tooltip.trigger = item`.
### What does the proposed API look like?
当 `trigger = 'item'` 时可以新增一个 context 参数:
```ts
tooltip: {
trigger: 'item',
formatter: (params, context) => {
console.log(context);
}
}
```
--
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] I hope to get all series information when tooltip.trigger = item [echarts]
Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #20579:
URL: https://github.com/apache/echarts/issues/20579#issuecomment-2537244504
use [getOption](https://echarts.apache.org/en/api.html#echartsInstance.getOption) - [Demo](https://echarts.apache.org/examples/en/editor.html?c=line-stack&code=PYBwLglsB2AEC8sDeAoWtJgDYFMBcya6GOAHmAQOQC2ArlpLADITQ6VEC-ANEWMMAYQQBVMQwAnCAHNpOCVQhgc1Sr3EAzYBOoBDMMoWwQIBAD5C49KDAJY1AJ4BhABa6JYAHRywAeXBQ0AAUAJQA3ETiEjhgtBJwlAAmEKTwlADUJp6J-roAktCJZOmUADwARhJmAM6euNBp6Tae1fIQOLX10mAuEeKcXOqwuHKFopGwOWC6BADalACiehBYarCUAKrQgbAAgonVa5QAahBFwHsHRwAiENEAxmBHAMo47vcusAvQ0qzsALqDIjSKSJcbiXAaCjrADMAFI1BMpNIXNDKAAWBFDdDlYAGYDUKjwxHie4waasJi6co4LAEMASWg4IHofiCXGkcHEDRvWLRLniaq6ABuOF21TyejkogG_RZsFIu1IEGqAowDhA-HW930OGk2gcJOIuNohXcDgA4roRLANLosK1sZNcnNKABZGBHAAqTKOAHUcIlvS5aEcAGJSF76F6myiA9A8IgOJUqtVgDVayjC-2--WtKQdOYTMRWaC6aiZpa6FZG8TpzVULB_WvEarTe4AayoXrx9pb6CmM1gswAjAAmAAM3FgI5hY-nI4nI4XMPR04AnFPYGOYVux4v48RE-IS-IyxWqFsdvtDk7WRnG8277A27pO93e6tn4O5mPJwuAA55xnddl23VdpzHTdpxhXcYIPCZj2IU9iHPTNTnOS5bwme8G3WJs2H7F92y7dYe2mL8cOdaY5hHABWPc50gpcFzotcQK3WCt3RBD-idFD0DQqhbgeJ5n3rTMCPYZ9X3fMjPyIn9hznTimN
gXcwNg9iYWg9S4PUydDwTfiqKE9ZXneT5vl-QjxIffCnyo2TSMoci-2_F1hyArd1zUzcwN89jx102d9NnQzEKIQFODCIA).
--
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] I hope to get all series information when tooltip.trigger = item [echarts]
Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart commented on issue #20579:
URL: https://github.com/apache/echarts/issues/20579#issuecomment-2537494343
The `getOption` API is expensive and it's not first recommended. Except for this, I think there is no public API to get such information, but I still post a [workaround](https://echarts.apache.org/examples/editor.html?c=line-simple&code=PYBwLglsB2AEC8sDeAoWtJgDYFMBcya6GOAHmAQOQC2ArlpLADITQ6VEC-ANEWMMAYQQBVMQwAnCAHNpOCVQhgc1Sr3EAzYBOoBDMMoWwAFCF0Td1AM4BKBAD5C49AGMYVsLCvyIOKwFlgABMcLARYagBPAGEAC3MwImdYADo5MECQrGMbJOcAenzYF3joOS8fPwBJaBDSWAgNWEjgWlgAd11oT35YdNhgMFj5Cqk_BugtHX0oaDzxQoGJWFpvDGHYAAMcXRKAZUqrTdgNWmgXSBgMYAbDfRxYXSww7zGreeJFgCNaTxBcXRraCDCAuB5DB6bdKZULHACCAAUqg0rLBgX9aF8sKCTto0cB2h90ItVg8lBNYCAJMFaBdZrAcNAAG4QanURmeFzmHCnZ6RImpdIHN4AIUiNTqpnMlisKVevisErINgA3B83NArIIcCksMBpMZKPLxqwtGpRgqYVgUqBLtBVer3J4pnoDCNEABtAWbFy0CQSDmwIL6XQEAAkSDMFmsKWDYF0nE26mSW19_sDcd0StI4cj0pjmezieTyU2xtRmdz5atNvAs1jIcTHwAumrkgGwH64C79IYUgArYCsQ0AHi-EnslAd4k4XGTuDktVEeUrsA9lAAonoIFhzZQAKrQelwoJWPcANQgIRuJ7P3FglAAIqycBc9wdzCVYBuyqx2M25yIaQpCCZdxFwDQKAfABmABSNQ8ikaRYigygABZ4JLWAvkGfhqCoOCEPEDV41YJhdC
-UICDACRaBwQD0H4QQcJzJxiA0HZOwDMDnCsXQmRwOFFT0ORRFnGcGNgUg4VICArB4xjIhAfAHy5ZRpG0SIiOIHCzmDCRIgAcV0EQTiebwsNXddAmgPcABU6L3AB1HAgns2JaD3AAxKR330d8zkoAD0B4IhIhkuSFIwJSVMoJknkcyTywIL1xDEZxoEsWKt10HdtPEMAYqobE2Hy4gPF2ABrKg7MGJ4yvQKyAEYACYAAZ7ya6CWs6tqms66C0PvABODrYBa6Cxpapq2uC4hQrSj5MvZKhD2PU8Gui5Tir_TaKpcaqH1q-NdywxqQxSlr2s6gAOHrYCa4b-vGwb7xa0b72gybPpmuaQqw9LxGW2LL2vWBb02wrtofEr2DOrx4wOmq6tOj5moAVim7q3r6zr0aGh6PtgL6xrQ368gW4hAeIYGqGfAM33hqHYthvbEcOyhjvq-GrO6savvuybnq-gnoKJknPvav7YEp9BqfQWmHw_CQvx_aRdqZoqYY1j59o5rnUeSKy7rG4bsdgUbnrNgnWqJrrvoevnpfE2AAM4FUgA) that uses inner APIs.
--
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] I hope to get all series information when tooltip.trigger = item [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on issue #20579:
URL: https://github.com/apache/echarts/issues/20579#issuecomment-2536823983
@li-jia-nan 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>
**BODY**
### What problem does this feature solve?
The `tooltip.formatter` method accepts a `params` parameter. When `tooltip.trigger = item`, `params` is the series data of the current hover. When `tooltip.trigger = axis`, `params` is an array. Contains all series data
I need to display all the series information in the tooltip when `tooltip.trigger = item`, so I hope that when `tooltip.trigger = item`, I can also get all the series data
---
The `tooltip.formatter` method accepts a params. When `tooltip.trigger = item`, `params` is the series data of the current hover. When `tooltip.trigger = axis`, `params` is an array containing all series data.
I need to display all series info in the tooltip when `tooltip.trigger = item`, so I hope to get all series data when `tooltip.trigger = item`.
### What does the proposed API look like?
When `trigger = 'item'` you can add a context parameter:
```ts
tooltip: {
trigger: 'item',
formatter: (params, context) => {
console.log(context);
}
}
```
</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