Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/chart/radar/radarLayout.js
Original file line number Diff line number Diff line change
@@ -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'];
}
});
});
}