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

Function setRenderOpts

src/helpers/helpers.canvas.ts:385–405  ·  view source on GitHub ↗
(ctx: CanvasRenderingContext2D, opts: RenderTextOpts)

Source from the content-addressed store, hash-verified

383}
384
385function setRenderOpts(ctx: CanvasRenderingContext2D, opts: RenderTextOpts) {
386 if (opts.translation) {
387 ctx.translate(opts.translation[0], opts.translation[1]);
388 }
389
390 if (!isNullOrUndef(opts.rotation)) {
391 ctx.rotate(opts.rotation);
392 }
393
394 if (opts.color) {
395 ctx.fillStyle = opts.color;
396 }
397
398 if (opts.textAlign) {
399 ctx.textAlign = opts.textAlign;
400 }
401
402 if (opts.textBaseline) {
403 ctx.textBaseline = opts.textBaseline;
404 }
405}
406
407function decorateText(
408 ctx: CanvasRenderingContext2D,

Callers 1

renderTextFunction · 0.85

Calls 1

isNullOrUndefFunction · 0.85

Tested by

no test coverage detected