src/charts/bullet.js
function drawTitles() {
            if (hasTitle()) {
                // either use title provided from the data
                // or customTitle provided via API method call
                if (legendGroup) {
                    legendGroup.remove();
                }

                legendGroup = svg.select('.metadata-group')
                  .append('g')
                    .classed('legend-group', true)
                    .attr('transform', `translate(0, ${chartHeight / 2})`);


                // override title with customTitle if given
                if (customTitle) {
                    title = customTitle;
                }

                titleEl = legendGroup.selectAll('text.bullet-title')
                  .data([1])
                  .enter()
                    .append('text')
                      .attr('class', 'bullet-title x-axis-label')
                      .text(title);

                // either use subtitle provided from the data
                // or customSubtitle provided via API method call
                if (subtitle || customSubtitle) {

                    // override subtitle with customSubtitle if given
                    if (customSubtitle) {
                        subtitle = customSubtitle;
                    }

                    titleEl = legendGroup.selectAll('text.bullet-subtitle')
                      .data([1])
                      .enter()
                        .append('text')
                          .attr('class', 'bullet-subtitle x-axis-label')
                          .attr('y', subtitleSpacing)
                          .text(subtitle);
                }
            }
        }
function drawTitles() {
            if (hasTitle()) {
                // either use title provided from the data
                // or customTitle provided via API method call
                if (legendGroup) {
                    legendGroup.remove();
                }

                legendGroup = svg.select('.metadata-group')
                  .append('g')
                    .classed('legend-group', true)
                    .attr('transform', `translate(0, ${chartHeight / 2})`);


                // override title with customTitle if given
                if (customTitle) {
                    title = customTitle;
                }

                titleEl = legendGroup.selectAll('text.bullet-title')
                  .data([1])
                  .enter()
                    .append('text')
                      .attr('class', 'bullet-title x-axis-label')
                      .text(title);

                // either use subtitle provided from the data
                // or customSubtitle provided via API method call
                if (subtitle || customSubtitle) {

                    // override subtitle with customSubtitle if given
                    if (customSubtitle) {
                        subtitle = customSubtitle;
                    }

                    titleEl = legendGroup.selectAll('text.bullet-subtitle')
                      .data([1])
                      .enter()
                        .append('text')
                          .attr('class', 'bullet-subtitle x-axis-label')
                          .attr('y', subtitleSpacing)
                          .text(subtitle);
                }
            }
        }
function drawTitles ( ) { if ( hasTitle ( ) ) { // either use title provided from the data // or customTitle provided via API method call if ( legendGroup ) { legendGroup . remove ( ) ; } legendGroup = svg . select ( '.metadata-group' ) . append ( 'g' ) . classed ( 'legend-group' , true ) . attr ( 'transform' , ` ${ chartHeight / 2 } ` ) ; // override title with customTitle if given if ( customTitle ) { title = customTitle ; } titleEl = legendGroup . selectAll ( 'text.bullet-title' ) . data ( [ 1 ] ) . enter ( ) . append ( 'text' ) . attr ( 'class' , 'bullet-title x-axis-label' ) . text ( title ) ; // either use subtitle provided from the data // or customSubtitle provided via API method call if ( subtitle || customSubtitle ) { // override subtitle with customSubtitle if given if ( customSubtitle ) { subtitle = customSubtitle ; } titleEl = legendGroup . selectAll ( 'text.bullet-subtitle' ) . data ( [ 1 ] ) . enter ( ) . append ( 'text' ) . attr ( 'class' , 'bullet-subtitle x-axis-label' ) . attr ( 'y' , subtitleSpacing ) . text ( subtitle ) ; } } }
Draws the title and subtitle components of chart
@return {void}
@private
Draws the title and subtitle components of chart