all files / chart3d/print-export/ export.js

100% Statements 26/26
100% Branches 6/6
100% Functions 8/8
100% Lines 26/26
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42                       4177×          
define(["require", "exports", "../../common/utils/export", "../../common/model/constants"], function (require, exports, export_1, constants_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var Export3D = (function () {
        function Export3D(chart) {
            this.chart = chart;
        }
        Export3D.prototype.export = function (type, fileName) {
            var exportChart = new export_1.ExportUtils(this.chart);
            var argsData = {
                cancel: false, width: null, height: null
            };
            this.chart.trigger(constants_1.beforeExport, argsData);
            if (!argsData.cancel) {
                exportChart.export(type, fileName, undefined, [this.chart]);
            }
        };
        Export3D.prototype.pdfExport = function (fileName, orientation, controls, width, height, isVertical, header, footer, exportToMultiplePage) {
            var exportChart = new export_1.ExportUtils(this.chart);
            controls = controls ? controls : [this.chart];
            var argsData = {
                cancel: false, width: width, height: height
            };
            this.chart.trigger(constants_1.beforeExport, argsData);
            if (!argsData.cancel) {
                exportChart.export('PDF', fileName, orientation, controls, width = argsData.width, height = argsData.height, isVertical, header, footer, exportToMultiplePage);
            }
        };
        Export3D.prototype.getDataUrl = function (chart) {
            var exportUtil = new export_1.ExportUtils(chart);
            return exportUtil.getDataUrl(chart);
        };
        Export3D.prototype.getModuleName = function () {
            return 'Export3D';
        };
        Export3D.prototype.destroy = function () {
        };
        return Export3D;
    }());
    exports.Export3D = Export3D;
});