src/charts/helpers/exportChart.js
/**
     * if passed, append title to the raw html to appear on graph
     * @param  {string} html     raw html string
     * @param  {string} title    title of the graph
     * @param  {number} svgWidth width of graph container
     * @return {string}         raw html with title prepended
     */
if passed, append title to the raw html to appear on graph
@param  {string} html     raw html string
@param  {string} title    title of the graph
@param  {number} svgWidth width of graph container
@return {string}         raw html with title prepended
if passed append title to the raw html to appear on graph @param { string } html raw html string @param { string } title title of the graph @param { number } svgWidth width of graph container @return { string } raw html with title prepended
function prependTitle(html, title, svgWidth) {
        if (!title || !svgWidth) {
            return html;
        }
        let {britechartsGreySchema} = colorSchemas;
        html =  html.replace(/<g/,`<text x="${this.margin().left}" y="${config.titleTopOffset}" font-family="${config.titleFontFamily}" font-size="${config.titleFontSize}" fill="${britechartsGreySchema[6]}"> ${title} </text><g `);
        return html;
    }
function prependTitle ( html , title , svgWidth ) { if ( ! title || ! svgWidth ) { return html ; } let { britechartsGreySchema } = colorSchemas ; html = html . replace ( / <g / , ` ${ this . margin ( ) . left } ${ config . titleTopOffset } ${ config . titleFontFamily } ${ config . titleFontSize } ${ britechartsGreySchema [ 6 ] } ${ title } ` ) ; return html ; }
if passed, append title to the raw html to appear on graph
 @param  {string} html     raw html string
 @param  {string} title    title of the graph
 @param  {number} svgWidth width of graph container
 @return {string}         raw html with title prepended
if passed append title to the raw html to appear on graph @param { string } html raw html string @param { string } title title of the graph @param { number } svgWidth width of graph container @return { string } raw html with title prepended