src/charts/bullet.js
function drawBullet() {
            if (rangesEl) {
                rangesEl.remove();
                measuresEl.remove();
                markersEl.remove();
            }

            rangesEl = svg.select('.chart-group')
              .selectAll('rect.range')
              .data(ranges)
              .enter()
                .append('rect')
                  .attr('fill', rangeColor)
                  .attr('opacity', (d, i) => rangeOpacityScale[i])
                  .attr('class', (d, i) => `range r${i}`)
                  .attr('width', barWidth)
                  .attr('height', chartHeight)
                  .attr('x', isReverse ? xScale : 0);

            measuresEl = svg.select('.chart-group')
              .selectAll('rect.measure')
              .data(measures)
              .enter()
                .append('rect')
                  .attr('fill', measureColor)
                  .attr('fill-opacity', (d, i) => measureOpacityScale[i])
                  .attr('class', (d, i) => `measure m${i}`)
                  .attr('width', barWidth)
                  .attr('height', getMeasureBarHeight)
                  .attr('x', isReverse ? xScale : 0)
                  .attr('y', getMeasureBarHeight);

            markersEl = svg.select('.chart-group')
              .selectAll('line.marker-line')
              .data(markers)
              .enter()
                .append('line')
                  .attr('class', 'marker-line')
                  .attr('stroke', measureColor)
                  .attr('stroke-width', markerStrokeWidth)
                  .attr('opacity', measureOpacityScale[0])
                  .attr('x1', xScale)
                  .attr('x2', xScale)
                  .attr('y1', 0)
                  .attr('y2', chartHeight);
        }
function drawBullet() {
            if (rangesEl) {
                rangesEl.remove();
                measuresEl.remove();
                markersEl.remove();
            }

            rangesEl = svg.select('.chart-group')
              .selectAll('rect.range')
              .data(ranges)
              .enter()
                .append('rect')
                  .attr('fill', rangeColor)
                  .attr('opacity', (d, i) => rangeOpacityScale[i])
                  .attr('class', (d, i) => `range r${i}`)
                  .attr('width', barWidth)
                  .attr('height', chartHeight)
                  .attr('x', isReverse ? xScale : 0);

            measuresEl = svg.select('.chart-group')
              .selectAll('rect.measure')
              .data(measures)
              .enter()
                .append('rect')
                  .attr('fill', measureColor)
                  .attr('fill-opacity', (d, i) => measureOpacityScale[i])
                  .attr('class', (d, i) => `measure m${i}`)
                  .attr('width', barWidth)
                  .attr('height', getMeasureBarHeight)
                  .attr('x', isReverse ? xScale : 0)
                  .attr('y', getMeasureBarHeight);

            markersEl = svg.select('.chart-group')
              .selectAll('line.marker-line')
              .data(markers)
              .enter()
                .append('line')
                  .attr('class', 'marker-line')
                  .attr('stroke', measureColor)
                  .attr('stroke-width', markerStrokeWidth)
                  .attr('opacity', measureOpacityScale[0])
                  .attr('x1', xScale)
                  .attr('x2', xScale)
                  .attr('y1', 0)
                  .attr('y2', chartHeight);
        }
function drawBullet ( ) { if ( rangesEl ) { rangesEl . remove ( ) ; measuresEl . remove ( ) ; markersEl . remove ( ) ; } rangesEl = svg . select ( '.chart-group' ) . selectAll ( 'rect.range' ) . data ( ranges ) . enter ( ) . append ( 'rect' ) . attr ( 'fill' , rangeColor ) . attr ( 'opacity' , ( d , i ) => rangeOpacityScale [ i ] ) . attr ( 'class' , ( d , i ) => ` ${ i } ` ) . attr ( 'width' , barWidth ) . attr ( 'height' , chartHeight ) . attr ( 'x' , isReverse ? xScale : 0 ) ; measuresEl = svg . select ( '.chart-group' ) . selectAll ( 'rect.measure' ) . data ( measures ) . enter ( ) . append ( 'rect' ) . attr ( 'fill' , measureColor ) . attr ( 'fill-opacity' , ( d , i ) => measureOpacityScale [ i ] ) . attr ( 'class' , ( d , i ) => ` ${ i } ` ) . attr ( 'width' , barWidth ) . attr ( 'height' , getMeasureBarHeight ) . attr ( 'x' , isReverse ? xScale : 0 ) . attr ( 'y' , getMeasureBarHeight ) ; markersEl = svg . select ( '.chart-group' ) . selectAll ( 'line.marker-line' ) . data ( markers ) . enter ( ) . append ( 'line' ) . attr ( 'class' , 'marker-line' ) . attr ( 'stroke' , measureColor ) . attr ( 'stroke-width' , markerStrokeWidth ) . attr ( 'opacity' , measureOpacityScale [ 0 ] ) . attr ( 'x1' , xScale ) . attr ( 'x2' , xScale ) . attr ( 'y1' , 0 ) . attr ( 'y2' , chartHeight ) ; }
Draws the measures of the bullet chart
@return {void}
@private
Draws the measures of the bullet chart