Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <div>
  2. <span class='title'>TITLE GOES HERE</span>
  3. <canvas id="bar" width="390" height="225"></canvas>
  4. </div>
  5.  
  6.  
  7. CSS :
  8. canvas {
  9. display:inline;
  10. }
  11. .title {
  12. font-size: 47px;
  13. font-weight: bold;
  14. opacity: 0.2;
  15. z-index: -1;
  16. margin-top: 20px;
  17. position: absolute;
  18. }
  19.  
  20. let myLineExtend = Chart.controllers.line.prototype.draw;
  21. Chart.helpers.extend(Chart.controllers.line.prototype, {
  22. draw: function() {
  23. myLineExtend.apply(this, arguments);
  24. // text styles below
  25. this.chart.chart.ctx.textAlign = "center"
  26. this.chart.chart.ctx.font = "20px Arial black";
  27. this.chart.chart.ctx.fillText("Lorem Ipsum Blah Blah", 300, 150) // text, x-pos, y-pos
  28. }
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement