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

Function getPieTextMaxLength

front/components/u-charts/u-charts.js:1149–1159  ·  view source on GitHub ↗
(series)

Source from the content-addressed store, hash-verified

1147}
1148
1149function getPieTextMaxLength(series) {
1150 series = getPieDataPoints(series);
1151 let maxLength = 0;
1152 for (let i = 0; i < series.length; i++) {
1153 let item = series[i];
1154 let text = item.format ? item.format(+item._proportion_.toFixed(2)) : util.toFixed(item._proportion_ * 100) + '%';
1155 maxLength = Math.max(maxLength, measureText(text));
1156 }
1157
1158 return maxLength;
1159}
1160
1161function fixColumeData(points, eachSpacing, columnLen, index, config, opts) {
1162 return points.map(function(item) {

Callers 1

drawChartsFunction · 0.85

Calls 2

getPieDataPointsFunction · 0.85
measureTextFunction · 0.85

Tested by

no test coverage detected