src/charts/helpers/exportChart.js
/**
     * 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
@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 .png]
@param  {string} title       Title for the image
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 . png ] @param { string } title Title for the image
function exportChart(d3svg, filename, title) {
        let img = createImage(convertSvgToHtml.call(this, d3svg, title));
        img.onload = handleImageLoad.bind(
                img,
                createCanvas(this.width(), this.height()),
                filename
            );
    }
function exportChart ( d3svg , filename , title ) { 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 @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