Skip to content

Commit

Permalink
Fix missing CanvasGradient
Browse files Browse the repository at this point in the history
  • Loading branch information
typpo committed Nov 12, 2020
1 parent f31536b commit 3ac7051
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ function renderChartJs(width, height, backgroundColor, devicePixelRatio, untrust
chart = untrustedChart;
}

// Patch some bugs and issues.
fixNodeVmObject(chart);
if (global.CanvasGradient === undefined) {
// See https://github.com/vmpowerio/chartjs-node/issues/26
global.CanvasGradient = function() {};
}

chart.options = chart.options || {};

Expand Down

0 comments on commit 3ac7051

Please sign in to comment.