Skip to content

Commit e462644

Browse files
Fix chartJS generate image issue #786
1 parent 6ce73cc commit e462644

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

js/render-chartjs.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,15 @@
118118
labels: labels,
119119
datasets: datasets
120120
},
121-
options: settings
121+
options: settings,
122+
plugins: [{
123+
afterRender: function () {
124+
var canvas = $( 'canvas' )[0];
125+
if ( $( '#chart-img' ).length ) {
126+
$( '#chart-img' ).val( canvas.toDataURL() );
127+
}
128+
},
129+
}],
122130
});
123131

124132
// this line needs to be included twice. This is not an error.

0 commit comments

Comments
 (0)