You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "selunders (via GitHub)" <gi...@apache.org> on 2024/07/18 19:11:43 UTC
Re: [I] Legend is not displayed when name repeats [echarts]
selunders commented on issue #18242:
URL: https://github.com/apache/echarts/issues/18242#issuecomment-2237348771
I ran into the same issue, ended up appending zero-width spaces (\u200B)
```js
const mySeries = myData.map((data, index) => ({
name: `${data.name}${'\u200B'.repeat(index)}`,
... // rest of series info
})
```
If you wanted to be extra careful to prevent duplicates:
```js
name: `${data.name.replace(/\u200B/g, "")}${`\u200B`.repeat(index)}
```
Modifying @helgasoft 's [example from earlier](https://github.com/apache/echarts/issues/18242#issuecomment-1967090865):

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