You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/10/15 08:22:04 UTC

[GitHub] Ovilia closed pull request #9162: fix: #8962 闭合多边形时,如果第一个值为NaN,导致最后值也为NaN,渲染不出连接线。

Ovilia 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..c267f0476 100644
--- a/src/chart/radar/radarLayout.js
+++ b/src/chart/radar/radarLayout.js
@@ -17,6 +17,7 @@
 * under the License.
 */
 
+import * as zrUtil from 'zrender/src/core/util';
 
 export default function (ecModel) {
     ecModel.eachSeriesByType('radar', function (seriesModel) {
@@ -38,8 +39,18 @@ export default function (ecModel) {
 
         data.each(function (idx) {
             // Close polygon
-            points[idx][0] && points[idx].push(points[idx][0].slice());
+
+            var firstPoint = findFirstActualPoint();
+  
+            // Copy the first actual point to the end of the array
+            points[idx].push(firstPoint.slice());
             data.setItemLayout(idx, points[idx]);
+
+            function findFirstActualPoint() {
+                return zrUtil.find(points[idx], function (point) {
+                    return !isNaN(point[0]) && !isNaN(point[1]);
+                }) || ['NaN', 'NaN'];
+            }
         });
     });
 }
\ No newline at end of file


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org