Chart - export as base64Image return empty
I'm submitting a ... (check one with "x")
[ ] bug report => Search github for a similar issue or PR before submitting [ x] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap [ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Current behavior Chart export empty image.
Expected behavior
-
in html chart is defined as below : <p-chart #chartCons type="line" [data]="dataChart[0]" [responsive]="true" [options]="options[0]">
-
in ts file : @ViewChild('chartCons') chartCons: UIChart;
setTimeout(() => { var image = this.chartCons.getBase64Image(); },50);
-
console log return : data:,
PrimeNG version: 5.2.1 Chart.js version : 2.7.1 Angular : 5.2.0
Language: TypeScript 2.4.0
Workaround is to put in options below code : animation: { duration: 50, // general animation time onComplete: function (animation) { this.toBase64Image(); }
and increase setTimeout time when run getBase64Image()