src/charts/bar.js
function drawBars() {
            let bars;

            if (isAnimated) {
                bars = svg.select('.chart-group').selectAll('.bar')
                    .data(dataZeroed);

                if (isHorizontal) {
                    drawHorizontalBars(bars);
                } else {
                    drawVerticalBars(bars);
                }

                bars = svg.select('.chart-group').selectAll('.bar')
                    .data(data);

                if (isHorizontal) {
                    drawAnimatedHorizontalBars(bars);
                } else {
                    drawAnimatedVerticalBars(bars);
                }

                // Exit
                bars.exit()
                    .transition()
                    .style('opacity', 0)
                    .remove();
            } else {
                bars = svg.select('.chart-group').selectAll('.bar')
                    .data(data);

                if (isHorizontal) {
                    drawHorizontalBars(bars);
                } else {
                    drawVerticalBars(bars);
                }

                // Exit
                bars.exit()
                    .remove();
            }

        }
function drawBars() {
            let bars;

            if (isAnimated) {
                bars = svg.select('.chart-group').selectAll('.bar')
                    .data(dataZeroed);

                if (isHorizontal) {
                    drawHorizontalBars(bars);
                } else {
                    drawVerticalBars(bars);
                }

                bars = svg.select('.chart-group').selectAll('.bar')
                    .data(data);

                if (isHorizontal) {
                    drawAnimatedHorizontalBars(bars);
                } else {
                    drawAnimatedVerticalBars(bars);
                }

                // Exit
                bars.exit()
                    .transition()
                    .style('opacity', 0)
                    .remove();
            } else {
                bars = svg.select('.chart-group').selectAll('.bar')
                    .data(data);

                if (isHorizontal) {
                    drawHorizontalBars(bars);
                } else {
                    drawVerticalBars(bars);
                }

                // Exit
                bars.exit()
                    .remove();
            }

        }
function drawBars ( ) { let bars ; if ( isAnimated ) { bars = svg . select ( '.chart-group' ) . selectAll ( '.bar' ) . data ( dataZeroed ) ; if ( isHorizontal ) { drawHorizontalBars ( bars ) ; } else { drawVerticalBars ( bars ) ; } bars = svg . select ( '.chart-group' ) . selectAll ( '.bar' ) . data ( data ) ; if ( isHorizontal ) { drawAnimatedHorizontalBars ( bars ) ; } else { drawAnimatedVerticalBars ( bars ) ; } // Exit bars . exit ( ) . transition ( ) . style ( 'opacity' , 0 ) . remove ( ) ; } else { bars = svg . select ( '.chart-group' ) . selectAll ( '.bar' ) . data ( data ) ; if ( isHorizontal ) { drawHorizontalBars ( bars ) ; } else { drawVerticalBars ( bars ) ; } // Exit bars . exit ( ) . remove ( ) ; } }
Draws the bar elements within the chart group
@private
Draws the bar elements within the chart group