src/charts/sparkline.js
function drawArea(){
            if (area) {
                svg.selectAll('.sparkline-area').remove();
            }

            area = d3Shape.area()
                .x(({date}) => xScale(date))
                .y0(() => yScale(0) + lineStrokeWidth / 2)
                .y1(({value}) => yScale(value))
                .curve(d3Shape.curveBasis);

            svg.select('.chart-group')
              .append('path')
                .datum(data)
                .attr('class', 'sparkline-area')
                .attr('fill', `url(#${areaGradientId})`)
                .attr('d', area)
                .attr('clip-path', `url(#${maskingClipId})`);
        }
function drawArea(){
            if (area) {
                svg.selectAll('.sparkline-area').remove();
            }

            area = d3Shape.area()
                .x(({date}) => xScale(date))
                .y0(() => yScale(0) + lineStrokeWidth / 2)
                .y1(({value}) => yScale(value))
                .curve(d3Shape.curveBasis);

            svg.select('.chart-group')
              .append('path')
                .datum(data)
                .attr('class', 'sparkline-area')
                .attr('fill', `url(#${areaGradientId})`)
                .attr('d', area)
                .attr('clip-path', `url(#${maskingClipId})`);
        }
function drawArea ( ) { if ( area ) { svg . selectAll ( '.sparkline-area' ) . remove ( ) ; } area = d3Shape . area ( ) . x ( ( { date } ) => xScale ( date ) ) . y0 ( ( ) => yScale ( 0 ) + lineStrokeWidth / 2 ) . y1 ( ( { value } ) => yScale ( value ) ) . curve ( d3Shape . curveBasis ) ; svg . select ( '.chart-group' ) . append ( 'path' ) . datum ( data ) . attr ( 'class' , 'sparkline-area' ) . attr ( 'fill' , ` ${ areaGradientId } ` ) . attr ( 'd' , area ) . attr ( 'clip-path' , ` ${ maskingClipId } ` ) ; }
Draws the area that will be placed below the line
@private
Draws the area that will be placed below the line