META-INF.assets.rjzjh.echarts.src.chart.radar.radarLayout.js Maven / Gradle / Ivy
define(function (require) {
return function (ecModel) {
ecModel.eachSeriesByType('radar', function (seriesModel) {
var data = seriesModel.getData();
var points = [];
var coordSys = seriesModel.coordinateSystem;
if (!coordSys) {
return;
}
function pointsConverter(val, idx) {
points[idx] = points[idx] || [];
points[idx][i] = coordSys.dataToPoint(val, i);
}
for (var i = 0; i < coordSys.getIndicatorAxes().length; i++) {
var dim = data.dimensions[i];
data.each(dim, pointsConverter);
}
data.each(function (idx) {
// Close polygon
points[idx][0] && points[idx].push(points[idx][0].slice());
data.setItemLayout(idx, points[idx]);
});
});
};
});