Chartjs-Exporting dynamic chartjs to jspdf

0👍

Set the canvas backgrounds to white:

canvas {
  background-color: #fff;
}

If that doesn’t work, draw the canvas background in your chart’s plugins object:

plugins: [
  {
    id: 'background',
    beforeDraw: function(chartInstance) {
      var chart = chartInstance.chart;
      var ctx = chart.ctx;
      ctx.fillStyle = backgroundColor;
      ctx.fillRect(0, 0, chart.width, chart.height);
    }
  }
],

Leave a comment