MCPcopy Create free account
hub / github.com/chartjs/Chart.js / path

Method path

src/elements/element.line.js:406–418  ·  view source on GitHub ↗

* Append all segments of this line to current path. * @param {CanvasRenderingContext2D|Path2D} ctx * @param {number} [start] * @param {number} [count] * @returns {undefined|boolean} - true if line is a full loop (path should be closed)

(ctx, start, count)

Source from the content-addressed store, hash-verified

404 * @returns {undefined|boolean} - true if line is a full loop (path should be closed)
405 */
406 path(ctx, start, count) {
407 const segments = this.segments;
408 const segmentMethod = _getSegmentMethod(this);
409 let loop = this._loop;
410
411 start = start || 0;
412 count = count || (this.points.length - start);
413
414 for (const segment of segments) {
415 loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});
416 }
417 return !!loop;
418 }
419
420 /**
421 * Draw

Callers

nothing calls this directly

Calls 1

_getSegmentMethodFunction · 0.85

Tested by

no test coverage detected