MCPcopy Create free account
hub / github.com/CoderOpen/waimai / getRadarDataPoints

Function getRadarDataPoints

front/components/u-charts/u-charts.js:969–996  ·  view source on GitHub ↗
(angleList, center, radius, series, opts)

Source from the content-addressed store, hash-verified

967}
968
969function getRadarDataPoints(angleList, center, radius, series, opts) {
970 var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
971
972 var radarOption = opts.extra.radar || {};
973 radarOption.max = radarOption.max || 0;
974 var maxData = Math.max(radarOption.max, Math.max.apply(null, dataCombine(series)));
975
976 var data = [];
977 for (let i = 0; i < series.length; i++) {
978 let each = series[i];
979 let listItem = {};
980 listItem.color = each.color;
981 listItem.data = [];
982 each.data.forEach(function(item, index) {
983 let tmp = {};
984 tmp.angle = angleList[index];
985
986 tmp.proportion = item / maxData;
987 tmp.position = convertCoordinateOrigin(radius * tmp.proportion * process * Math.cos(tmp.angle), radius * tmp.proportion *
988 process * Math.sin(tmp.angle), center);
989 listItem.data.push(tmp);
990 });
991
992 data.push(listItem);
993 }
994
995 return data;
996}
997
998function getPieDataPoints(series, radius) {
999 var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;

Callers 1

drawRadarDataPointsFunction · 0.85

Calls 2

dataCombineFunction · 0.85
convertCoordinateOriginFunction · 0.85

Tested by

no test coverage detected