Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div>
- <span class='title'>TITLE GOES HERE</span>
- <canvas id="bar" width="390" height="225"></canvas>
- </div>
- CSS :
- canvas {
- display:inline;
- }
- .title {
- font-size: 47px;
- font-weight: bold;
- opacity: 0.2;
- z-index: -1;
- margin-top: 20px;
- position: absolute;
- }
- let myLineExtend = Chart.controllers.line.prototype.draw;
- Chart.helpers.extend(Chart.controllers.line.prototype, {
- draw: function() {
- myLineExtend.apply(this, arguments);
- // text styles below
- this.chart.chart.ctx.textAlign = "center"
- this.chart.chart.ctx.font = "20px Arial black";
- this.chart.chart.ctx.fillText("Lorem Ipsum Blah Blah", 300, 150) // text, x-pos, y-pos
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement