src/charts/legend.js
function centerInlineLegendOnSVG() {
            let legendGroupSize = svg.select('g.legend-container-group').node().getBoundingClientRect().width + getLineElementMargin();
            let emptySpace = width - legendGroupSize;
            let newXPosition = (emptySpace/2);

            if (emptySpace > 0) {
                svg.select('g.legend-container-group')
                    .attr('transform', `translate(${newXPosition},0)`)
            }
        }
function centerInlineLegendOnSVG() {
            let legendGroupSize = svg.select('g.legend-container-group').node().getBoundingClientRect().width + getLineElementMargin();
            let emptySpace = width - legendGroupSize;
            let newXPosition = (emptySpace/2);

            if (emptySpace > 0) {
                svg.select('g.legend-container-group')
                    .attr('transform', `translate(${newXPosition},0)`)
            }
        }
function centerInlineLegendOnSVG ( ) { let legendGroupSize = svg . select ( 'g.legend-container-group' ) . node ( ) . getBoundingClientRect ( ) . width + getLineElementMargin ( ) ; let emptySpace = width - legendGroupSize ; let newXPosition = ( emptySpace / 2 ) ; if ( emptySpace > 0 ) { svg . select ( 'g.legend-container-group' ) . attr ( 'transform' , ` ${ newXPosition } ` ) } }
Centers the legend on the chart given that is a single line of labels
@return {void}
@private
Centers the legend on the chart given that is a single line of labels