Export Kendo chart to pdf or png

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

+3


source to share


2 answers


Perhaps if you are using a third party tool like InkScape . The latter can convert SVG (Kendo's proprietary UI diagram format) to almost anything, including PNG and PDF. You can use the svg chart method to get a basic SVG and then send it to a remote service.



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

+1


source


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

If you want to export a png file, you can do so using the exportImage function :

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

      



For PDF, this is 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 can find more information on these functions in the Kendo Chart API documentation .

+3


source







All Articles