You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[charts] Highlight doesn't work when series ID is a number #18415
Highlight doesn't work when series ID is a number. This is because we use the series ID as a key in the series object here.
Keys in object cannot be numbers and will automatically be coerced to string:
Each property name is a string or a Symbol. Any other value, including a number, is coerced to a string. This outputs 'value', since 1 is coerced into '1'.
The second series' ID is 1 instead of "1", so highlight doesn't work. If you change it to a string, then it works.
Screen.Recording.2025-06-17.at.17.42.02.mov
Alternatives
Restrict series IDs to strings. This way, we can keep using objects for storing series. I think this might be best because data-series doesn't distinguish between strings and numbers, so we'll have issues there as well.
Use a Map to store series. This way, we can keep using numbers for keys, but it would break all use*SeriesContext because it is exported and accessing maps using the bracket notation doesn't work.
Hey,
I would like to take up this issue, and I think going with option 1 would be more suitable as it makes it backward compatible and doesn't break existing functionality.
Let me know if you think otherwise.
Thanks.
The option 1 seems to be the way to go. It 's not the first time we face this kind of issue. But it's a breaking change. ANy body using a number as series' id will get TS complain, preventing build of the application.
In theory this should not be an issue because we should not rely on the object keys, but on either
seriesOrder content which is an array o ids. So the number/string are not an issue
series[id].id which is also not an issue for string/number
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
Activity
noobyogi0010 commentedon Jun 17, 2025
Hey,
I would like to take up this issue, and I think going with option
1would be more suitable as it makes it backward compatible and doesn't break existing functionality.Let me know if you think otherwise.
Thanks.
alexfauquette commentedon Jun 18, 2025
I've open #18423 to fix this.
The option 1 seems to be the way to go. It 's not the first time we face this kind of issue. But it's a breaking change. ANy body using a number as series' id will get TS complain, preventing build of the application.
In theory this should not be an issue because we should not rely on the object keys, but on either
seriesOrdercontent which is an array o ids. So the number/string are not an issueseries[id].idwhich is also not an issue for string/numberalexfauquette commentedon Jun 18, 2025
@noobyogi0010 Thanks for proposing worling on this one, but we found a workaround for this issue
noobyogi0010 commentedon Jun 18, 2025
No worries at all! Glad it's resolved!
Thanks!
JCQuintas commentedon Jun 18, 2025
Fixed by #18423
github-actions commentedon Jun 18, 2025
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.