src/charts/scatter-plot.js
function drawAxisLabels() {
            // If y-axis label is given, draw it
            if (yAxisLabel) {
                if (yAxisLabelEl) {
                    svg.selectAll('.y-axis-label-text').remove();
                }

                yAxisLabelEl = svg.select('.axis-labels-group')
                    .append('g')
                    .attr('class', 'y-axis-label')
                      .append('text')
                      .classed('y-axis-label-text', true)
                      .attr('x', -chartHeight / 2)
                      .attr('y', yAxisLabelOffset - xAxisPadding.left)
                      .attr('text-anchor', 'middle')
                      .attr('transform', 'rotate(270 0 0)')
                      .text(yAxisLabel)
            }

            // If x-axis label is given, draw it
            if (xAxisLabel) {
                if (xAxisLabelEl) {
                    svg.selectAll('.x-axis-label-text').remove();
                }

                xAxisLabelEl = svg.selectAll('.axis-labels-group')
                    .append('g')
                    .attr('class', 'x-axis-label')
                      .append('text')
                      .classed('x-axis-label-text', true)
                      .attr('x', chartWidth / 2)
                      .attr('y', chartHeight - xAxisLabelOffset)
                      .attr('text-anchor', 'middle')
                      .text(xAxisLabel);
            }
        }
function drawAxisLabels() {
            // If y-axis label is given, draw it
            if (yAxisLabel) {
                if (yAxisLabelEl) {
                    svg.selectAll('.y-axis-label-text').remove();
                }

                yAxisLabelEl = svg.select('.axis-labels-group')
                    .append('g')
                    .attr('class', 'y-axis-label')
                      .append('text')
                      .classed('y-axis-label-text', true)
                      .attr('x', -chartHeight / 2)
                      .attr('y', yAxisLabelOffset - xAxisPadding.left)
                      .attr('text-anchor', 'middle')
                      .attr('transform', 'rotate(270 0 0)')
                      .text(yAxisLabel)
            }

            // If x-axis label is given, draw it
            if (xAxisLabel) {
                if (xAxisLabelEl) {
                    svg.selectAll('.x-axis-label-text').remove();
                }

                xAxisLabelEl = svg.selectAll('.axis-labels-group')
                    .append('g')
                    .attr('class', 'x-axis-label')
                      .append('text')
                      .classed('x-axis-label-text', true)
                      .attr('x', chartWidth / 2)
                      .attr('y', chartHeight - xAxisLabelOffset)
                      .attr('text-anchor', 'middle')
                      .text(xAxisLabel);
            }
        }
function drawAxisLabels ( ) { // If y-axis label is given, draw it if ( yAxisLabel ) { if ( yAxisLabelEl ) { svg . selectAll ( '.y-axis-label-text' ) . remove ( ) ; } yAxisLabelEl = svg . select ( '.axis-labels-group' ) . append ( 'g' ) . attr ( 'class' , 'y-axis-label' ) . append ( 'text' ) . classed ( 'y-axis-label-text' , true ) . attr ( 'x' , - chartHeight / 2 ) . attr ( 'y' , yAxisLabelOffset - xAxisPadding . left ) . attr ( 'text-anchor' , 'middle' ) . attr ( 'transform' , 'rotate(270 0 0)' ) . text ( yAxisLabel ) } // If x-axis label is given, draw it if ( xAxisLabel ) { if ( xAxisLabelEl ) { svg . selectAll ( '.x-axis-label-text' ) . remove ( ) ; } xAxisLabelEl = svg . selectAll ( '.axis-labels-group' ) . append ( 'g' ) . attr ( 'class' , 'x-axis-label' ) . append ( 'text' ) . classed ( 'x-axis-label-text' , true ) . attr ( 'x' , chartWidth / 2 ) . attr ( 'y' , chartHeight - xAxisLabelOffset ) . attr ( 'text-anchor' , 'middle' ) . text ( xAxisLabel ) ; } }
Draws axis labels next to x and y axis to
represent data value labels on the chart
@return {void}
@private
Draws axis labels next to x and y axis to represent data value labels on the chart