src/charts/helpers/export.js
function exportChart(d3svg, filename, title) {
        if (isIE) {
            console.error(IE_ERROR_MSG);

            return false;
        }

        let img = createImage(convertSvgToHtml.call(this, d3svg, title));

        img.onload = handleImageLoad.bind(
                img,
                createCanvas(this.width(), this.height()),
                filename
            );
    }
function exportChart(d3svg, filename, title) {
        if (isIE) {
            console.error(IE_ERROR_MSG);

            return false;
        }

        let img = createImage(convertSvgToHtml.call(this, d3svg, title));

        img.onload = handleImageLoad.bind(
                img,
                createCanvas(this.width(), this.height()),
                filename
            );
    }
function exportChart ( d3svg , filename , title ) { if ( isIE ) { console . error ( IE_ERROR_MSG ) ; return false ; } let img = createImage ( convertSvgToHtml . call ( this , d3svg , title ) ) ; img . onload = handleImageLoad . bind ( img , createCanvas ( this . width ( ) , this . height ( ) ) , filename ) ; }
Main function to be used as a method by chart instances to export charts to png
@param  {array} svgs         (or an svg element) pass in both chart & legend as array or just chart as svg or in array
@param  {string} filename    [download to be called <filename>.png]
@param  {string} title       Title for the image
Main function to be used as a method by chart instances to export charts to png