[GitHub] [echarts] roojay520 commented on a diff in pull request #18390: fix(legend): fix dataItem undefined error
roojay520 commented on code in PR #18390: URL: https://github.com/apache/echarts/pull/18390#discussion_r1143408341 ## src/component/legend/LegendModel.ts: ## @@ -362,6 +362,13 @@ class LegendModel extends ComponentMode name: dataItem as string }; } + +const isNil = (val: any) => val === null || val === undefined || val === ''; Review Comment: yeh, although the series name `''` is useless for legend, it is indeed a valid value. I changed the code and removed the handling of `''` -- 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-unsubscr...@echarts.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
[GitHub] [echarts] roojay520 commented on a diff in pull request #18390: fix(legend): fix dataItem undefined error
roojay520 commented on code in PR #18390: URL: https://github.com/apache/echarts/pull/18390#discussion_r1146246490 ## src/component/legend/LegendModel.ts: ## @@ -362,6 +362,13 @@ class LegendModel extends ComponentMode name: dataItem as string }; } + +const isNil = (val: any) => val === null || val === undefined; +// remove null legend names +if (isNil(dataItem) || isNil(dataItem.name)) { Review Comment: sry, the code has been fixed -- 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-unsubscr...@echarts.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org