This is a migrated thread and some comments may be shown as answers.

Kendo UI for Angular 2 Chart - export to pdf

4 Answers 157 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Graham
Top achievements
Rank 1
Graham asked on 29 Jan 2017, 12:13 PM

Hello. 

Is there any way to export Chart component as a pdf file? 

I haven't found any method on the Cart itself. There's nothing close to "saveAsPDF".

I tried following way:

import { ChartComponent } from '@progress/kendo-angular-charts';
import { drawDOM, exportPDF, pdf } from '@progress/kendo-drawing';

drawDOM(kendoChart.element.nativeElement, {
    paperSize: 'auto',
    margin: { left: '1cm', top: '1cm', right: '1cm', bottom: '1cm' }
    })
   .then(function (group) {
        pdf.saveAs(group, 'SomeFile.pdf');
    });

When I render a chart as a canvas, it works fine, but the chart itself doesn't look great in the browser. When I render the chart in svg mode, I get an empty pdf document.  

Could you give me a hint on how to resolve this problem? I need svg Chart exported to .pdf.

4 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 30 Jan 2017, 09:00 AM
Hi,

Thank you for your interest in our offering for Angular.

We're working on adding support for PDF export to the chart. The exportPDF/saveAsPDF should make into a release in about a week.
The Drawing package is also shaping up for release along with its revamped documentation.

The drawDOM method is a different story though. The current implementation relies on the DOM to locate "exportable" components, something that won't work for Angular.
It will work for plain DOM content, but won't include components with their own export overrides such as the Chart.

Still, we intend to cover the scenarios we support with Kendo UI for jQuery on time for the May release.

Regards,
T. Tsonev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
esp
Top achievements
Rank 1
Veteran
answered on 05 Mar 2017, 09:17 PM

[quote]The exportPDF/saveAsPDF should make into a release in about a week.[/quote]

Any word on this? It seems this is not part of the Chart API yet.

0
T. Tsonev
Telerik team
answered on 07 Mar 2017, 03:53 PM
Hi,

We had to take a little detour and publish the File Saver and Drawing packages first. These are prerequisites for the PDF export.

We're now at the final steps for enabling PDF export in the charts. I've opened an issue that you can subscribe to for updates.

Regards,
T. Tsonev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
esp
Top achievements
Rank 1
Veteran
answered on 07 Mar 2017, 08:47 PM

[quote]I've opened an issue that you can subscribe to for updates. [/quote]

Excellent, thank you.

Tags
Charts
Asked by
Graham
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
esp
Top achievements
Rank 1
Veteran
Share this question
or