将剑道图表导出为带有angularJS徽标的pdf

时间:2016-08-12 04:37:50

标签: angularjs kendo-ui kendo-chart

这是我的angularjs代码,只导出pdf,但我想导出自定义徽标。对这个问题有任何帮助吗? 我的剑道图HTML代码在这里:

<div kendo-chart="vm.chart"
                 k-options="vm.chartOptions"
                 k-data-source="vm.chartOptions.datasource">
            </div>

导出按钮代码在这里..

vm.saveAsPdf = function (event) {
    var elem ;
    if (navigator.userAgent.indexOf("Chrome") !== -1) {
        elem = event.toElement;
    }
    else {
        elem = event.currentTarget;
    }
    //$(elem).parent().next().find('.k-chart').getKendoChart().saveAsPDF();
    debugger;
    var chart = $(".k-chart").getKendoChart();

    var fileName = $(elem).closest('li').children().find('.ng-binding').text().trim();
    chart.exportPDF({ paperSize: "auto", margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" } }).done(function (data) {
        kendo.saveAs({
            dataURI: data,
            fileName: fileName + ".pdf"
        });
    });
}

0 个答案:

没有答案