Пожалуйста, обратитесь к примеру ниже: https://stackblitz.com/edit/angular-ivy-eqvhys?file=src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp.comComponent.html,src%2Fapp%2Fapp.comComponent.ts, package.json
Пожалуйста, помогите мне решить проблему с видимостью диаграммы в файле PDF.
I found a workaround to convert chart into pdf:
1. Converted chart to png image by using below method
convertChartToImg(chartId): Observable<string> {
return new Observable(observer => {
const chart = document.querySelector(chartId);
if (chart) {
this.subs.add(this.captureService.getImage(canvas, true)
.pipe(
tap((img: string) => {
observer.next(img)
})
).subscribe());
}
})
}
2. Replaced chart with png image.
3. Updated my target element and send pdf.
Рабочий пример, пожалуйста, перейдите по ссылке ниже: