[Feature] accessing legend unselected series in tooltip formatter function
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 8
Description
### What problem does this feature solve?
https://echarts.apache.org/examples/en/editor.html?c=line-simple&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AE2aMiAbVoBZGL1i0AKgFcqM2gHUqAlXIAWClQDEOEFQGVmphdFoBdEgF8-6cjnxFUpMpRqyAbowA2SrT2jrD-bFTQAgTupABGwGBgwAC2BABEAEwApOmh6HhU4fQs0cQe6OkAjOlEAGYBhfywdiEkycD-kCAxzWBGrKxUHBmMuHh5zXWcKcwsIwAUjBwcAJTwAHyxHgJUcQqDw83o9DB4nVQAdP7ArEsrq82t6A4khUZUhLCizdukQmARN8qgBWAAMPFgmQAzBCoZkACyQzJVAAckKq0JBGIRAHZkQA2MHWfKkCjUOj-CDQZSQ6CMFLearpJ6kv6CYRiGFwzKI5FojFYnH4qFEknHTwU2RUmkyemMohZFkeZ6wWx2ADcQA
---
in the tooltip formatter callback, `arr` contains only legend selected series, making it almost impossible to access unselected ones. I wanna achieve something like this, notice the series unselected by legend are still shown in the tooltip
accessing the unselected data through `getOption` is not viable here, as one can unselect all series, making it impossible to get data index through `arr[0].dataIndex`. and different series may have different data layout, we can't simply reuse dataIndex
---
I did a lot of code reading but can't find where the `dataByCoordSys` is actually populated(checked `filterSeries` and related code but no luck
* can you point me the code path?
---
### What does the proposed API look like?
modify the `formatter` callback signature like this, it should be mostly backward compatible
if concerned, we could add `toString` and `toJSON` to the new object, or just append a new parameter instead
or we we could do the following, it works according to ECMA standards although it may look unconventional
Contributor guide
Assessment
This issue has not been assessed yet.