hling51325 closed pull request #9162: fix: #8962
闭合多边形时,如果第一个值为NaN,导致最后值也为NaN,渲染不出连接线。
URL: https://github.com/apache/incubator-echarts/pull/9162
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/src/chart/radar/radarLayout.js b/src/chart/radar/radarLayout.js
index 74fe9c685..dfb50962a 100644
--- a/src/chart/radar/radarLayout.js
+++ b/src/chart/radar/radarLayout.js
@@ -38,7 +38,12 @@ export default function (ecModel) {
data.each(function (idx) {
// Close polygon
- points[idx][0] && points[idx].push(points[idx][0].slice());
+
+ let index = points[idx].findIndex(([x, y]) => {
+ return !isNaN(x) && !isNaN(y)
+ })
+
+ index >= 0 && points[idx].push(points[idx][index].slice());
data.setItemLayout(idx, points[idx]);
});
});
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]