src/charts/stacked-area.js
/**
         * Builds the stacked layers layout
         * @return {D3Layout} Layout for drawing the chart
         * @private
         */
Builds the stacked layers layout
@return {D3Layout} Layout for drawing the chart
@private
Builds the stacked layers layout @return { D3Layout } Layout for drawing the chart @private
function buildLayers(){
            dataByDateFormatted = _.chain(dataByDate)
                .map((d) => _.extend(d, d.values))
                .map((d) => {
                    _(d).each((entry) => {
                        if(entry['name']) {
                            d[entry['name']] = entry.value;
                        }
                    });
                    d['date'] = new Date(d['key']);
                    return d;
                })
                .value();
            dataByDateZeroed = _.chain(JSON.parse(JSON.stringify(dataByDate)))
                .map((d) => _.extend(d, d.values))
                .map((d) => {
                    _(d).each((entry) => {
                        if(entry['name']) {
                            d[entry['name']] = 0;
                        }
                    });
                    d['date'] = new Date(d['key']);
                    return d;
                })
                .value();
            let keys = uniq(_(data).pluck('name'));
            let stack3 = d3Shape.stack()
                .keys(keys)
                .order(d3Shape.stackOrderNone)
                .offset(d3Shape.stackOffsetNone);
            layersInitial = stack3(dataByDateZeroed);
            layers = stack3(dataByDateFormatted);
        }
function buildLayers ( ) { dataByDateFormatted = _ . chain ( dataByDate ) . map ( ( d ) => _ . extend ( d , d . values ) ) . map ( ( d ) => { _ ( d ) . each ( ( entry ) => { if ( entry [ 'name' ] ) { d [ entry [ 'name' ] ] = entry . value ; } } ) ; d [ 'date' ] = new Date ( d [ 'key' ] ) ; return d ; } ) . value ( ) ; dataByDateZeroed = _ . chain ( JSON . parse ( JSON . stringify ( dataByDate ) ) ) . map ( ( d ) => _ . extend ( d , d . values ) ) . map ( ( d ) => { _ ( d ) . each ( ( entry ) => { if ( entry [ 'name' ] ) { d [ entry [ 'name' ] ] = 0 ; } } ) ; d [ 'date' ] = new Date ( d [ 'key' ] ) ; return d ; } ) . value ( ) ; let keys = uniq ( _ ( data ) . pluck ( 'name' ) ) ; let stack3 = d3Shape . stack ( ) . keys ( keys ) . order ( d3Shape . stackOrderNone ) . offset ( d3Shape . stackOffsetNone ) ; layersInitial = stack3 ( dataByDateZeroed ) ; layers = stack3 ( dataByDateFormatted ) ; }
Builds the stacked layers layout
 @return {D3Layout} Layout for drawing the chart
 @private
Builds the stacked layers layout @return { D3Layout } Layout for drawing the chart @private