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

Typescript definitions for exporting not found

1 Answer 102 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Falafel Support
Top achievements
Rank 1
Falafel Support asked on 27 Mar 2015, 09:34 PM
Hello,

I am trying to use exporting kendo chart as a TypeScript class to expose export methods across my application but both getKendoChart() and exportImage() (as does exportPDF and exportSVG) don't seem to be exposed.

Below is the JS I am trying to use  

var chart = $("#chart").getKendoChart();
chart.exportImage().done(function(data) {
kendo.saveAs({
dataURI: data,
fileName: "chart.png",
});
});

And below is the TypeScript file I am trying to create 
/// <reference path="../../scripts/typings/jquery/jquery.d.ts" />
/// <reference path="../../scripts/typings/kendo/kendo.all.d.ts" />
 
class KendoChartExporter {
    exportAsPng(id: string) {
        var chart = $("#chart").getKendoChart();
        chart.exportImage().done(function(data) {
            kendo.saveAs({
                dataURI: data,
                fileName: "chart.png",
                proxyURL: "http://demos.telerik.com/kendo-ui/service/export"
            });
        });
    }
}


Am I missing anything?

Thanks
Venkata

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 31 Mar 2015, 03:00 PM
Hello,

The code looks good, but it seems to be missing the cast to specific widget type:
var chart = <kendo.dataviz.ui.Chart>$("#chart").getKendoChart();

The methods should be accessible after you add it.

I hope this helps.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Charts
Asked by
Falafel Support
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or