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

Method _drawArgs

src/plugins/plugin.title.js:59–82  ·  view source on GitHub ↗
(offset)

Source from the content-addressed store, hash-verified

57 }
58
59 _drawArgs(offset) {
60 const {top, left, bottom, right, options} = this;
61 const align = options.align;
62 let rotation = 0;
63 let maxWidth, titleX, titleY;
64
65 if (this.isHorizontal()) {
66 titleX = _alignStartEnd(align, left, right);
67 titleY = top + offset;
68 maxWidth = right - left;
69 } else {
70 if (options.position === 'left') {
71 titleX = left + offset;
72 titleY = _alignStartEnd(align, bottom, top);
73 rotation = PI * -0.5;
74 } else {
75 titleX = right - offset;
76 titleY = _alignStartEnd(align, top, bottom);
77 rotation = PI * 0.5;
78 }
79 maxWidth = bottom - top;
80 }
81 return {titleX, titleY, maxWidth, rotation};
82 }
83
84 draw() {
85 const ctx = this.ctx;

Callers 1

drawMethod · 0.95

Calls 2

isHorizontalMethod · 0.95
_alignStartEndFunction · 0.85

Tested by

no test coverage detected