()
| 82 | } |
| 83 | |
| 84 | draw() { |
| 85 | const ctx = this.ctx; |
| 86 | const opts = this.options; |
| 87 | |
| 88 | if (!opts.display) { |
| 89 | return; |
| 90 | } |
| 91 | |
| 92 | const fontOpts = toFont(opts.font); |
| 93 | const lineHeight = fontOpts.lineHeight; |
| 94 | const offset = lineHeight / 2 + this._padding.top; |
| 95 | const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset); |
| 96 | |
| 97 | renderText(ctx, opts.text, 0, 0, fontOpts, { |
| 98 | color: opts.color, |
| 99 | maxWidth, |
| 100 | rotation, |
| 101 | textAlign: _toLeftRightCenter(opts.align), |
| 102 | textBaseline: 'middle', |
| 103 | translation: [titleX, titleY], |
| 104 | }); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | function createTitle(chart, titleOpts) { |
nothing calls this directly
no test coverage detected