user1877936
user1877936

Reputation: 363

Kendo chart export to pdf or png

I have a kendo chart with the remote data. Is it possible to export the chart to png or pdf format

Upvotes: 4

Views: 4119

Answers (2)

The_Black_Smurf
The_Black_Smurf

Reputation: 5269

Since Atanas Korchev's answer, kendo has implemented a built-in method to export a chart as a png, svg or a pdf file.

If you want to export a png file you can do it by using the exportImage function:

kendoChart.exportImage().done(function(data) {
    kendo.saveAs({
        dataURI: data,
        fileName: "chart.png"
    });
});

For a PDF, it's almost the same logic with the exportPDF function:

chart.exportPDF({ paperSize: "Auto", landscape: true }).done(function(data) {
    kendo.saveAs({
        dataURI: data,
        fileName: "chart.pdf"
    });
});

You may refer to kendo chart API documentation for more details about those functions.

Upvotes: 4

Atanas Korchev
Atanas Korchev

Reputation: 30671

It is possible if you use some third-party tool such as InkScape. The latter can convert SVG (the Kendo UI Chart native format) to pretty much anything else including PNG and PDF. You can use the svg method of the chart to get the underlying SVG and then send it to a remote service.

Here is an ASP.NET MVC application which shows how: https://github.com/telerik/kendo-examples-asp-net/tree/master/chart-inkscape-export

Upvotes: 2

Related Questions