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

Function drawArc

src/elements/element.arc.ts:218–239  ·  view source on GitHub ↗
(
  ctx: CanvasRenderingContext2D,
  element: ArcElement,
  offset: number,
  spacing: number,
  circular: boolean,
)

Source from the content-addressed store, hash-verified

216}
217
218function drawArc(
219 ctx: CanvasRenderingContext2D,
220 element: ArcElement,
221 offset: number,
222 spacing: number,
223 circular: boolean,
224) {
225 const {fullCircles, startAngle, circumference} = element;
226 let endAngle = element.endAngle;
227 if (fullCircles) {
228 pathArc(ctx, element, offset, spacing, endAngle, circular);
229 for (let i = 0; i < fullCircles; ++i) {
230 ctx.fill();
231 }
232 if (!isNaN(circumference)) {
233 endAngle = startAngle + (circumference % TAU || TAU);
234 }
235 }
236 pathArc(ctx, element, offset, spacing, endAngle, circular);
237 ctx.fill();
238 return endAngle;
239}
240
241function drawBorder(
242 ctx: CanvasRenderingContext2D,

Callers 1

drawMethod · 0.85

Calls 1

pathArcFunction · 0.85

Tested by

no test coverage detected