MCPcopy
hub / github.com/chartjs/Chart.js / _buildStackLine

Function _buildStackLine

src/plugins/plugin.filler/filler.target.stack.js:15–30  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

13 * @return {LineElement}
14 */
15export function _buildStackLine(source) {
16 const {scale, index, line} = source;
17 const points = [];
18 const segments = line.segments;
19 const sourcePoints = line.points;
20 const linesBelow = getLinesBelow(scale, index);
21 linesBelow.push(_createBoundaryLine({x: null, y: scale.bottom}, line));
22
23 for (let i = 0; i < segments.length; i++) {
24 const segment = segments[i];
25 for (let j = segment.start; j <= segment.end; j++) {
26 addPointsBelow(points, sourcePoints[j], linesBelow);
27 }
28 }
29 return new LineElement({points, options: {}});
30}
31
32/**
33 * @param {Scale} scale

Callers 1

_getTargetFunction · 0.90

Calls 3

_createBoundaryLineFunction · 0.90
getLinesBelowFunction · 0.85
addPointsBelowFunction · 0.85

Tested by

no test coverage detected