public/libraries.js
function () {
            var axis = this.axis,
              value = this.value,
              categories = axis.categories,
              dateTimeLabelFormat = this.dateTimeLabelFormat,
              numericSymbols = defaultOptions.lang.numericSymbols,
              i = numericSymbols && numericSymbols.length,
              multi,
              ret,
              formatOption = axis.options.labels.format,

            // make sure the same symbol is added for all labels on a linear axis
              numericSymbolDetector = axis.isLog ? value : axis.tickInterval;

            if (formatOption) {
                ret = format(formatOption, this);

            } else if (categories) {
                ret = value;

            } else if (dateTimeLabelFormat) { // datetime axis
                ret = dateFormat(dateTimeLabelFormat, value);

            } else if (i && numericSymbolDetector >= 1000) {
                // Decide whether we should add a numeric symbol like k (thousands) or M (millions).
                // If we are to enable this in tooltip or other places as well, we can move this
                // logic to the numberFormatter and enable it by a parameter.
                while (i-- && ret === UNDEFINED) {
                    multi = Math.pow(1000, i + 1);
                    if (numericSymbolDetector >= multi && numericSymbols[i] !== null) {
                        ret = numberFormat(value / multi, -1) + numericSymbols[i];
                    }
                }
            }

            if (ret === UNDEFINED) {
                if (mathAbs(value) >= 10000) { // add thousands separators
                    ret = numberFormat(value, 0);

                } else { // small numbers
                    ret = numberFormat(value, -1, UNDEFINED, ''); // #2466
                }
            }

            return ret;
        }
function () {
            var axis = this.axis,
              value = this.value,
              categories = axis.categories,
              dateTimeLabelFormat = this.dateTimeLabelFormat,
              numericSymbols = defaultOptions.lang.numericSymbols,
              i = numericSymbols && numericSymbols.length,
              multi,
              ret,
              formatOption = axis.options.labels.format,

            // make sure the same symbol is added for all labels on a linear axis
              numericSymbolDetector = axis.isLog ? value : axis.tickInterval;

            if (formatOption) {
                ret = format(formatOption, this);

            } else if (categories) {
                ret = value;

            } else if (dateTimeLabelFormat) { // datetime axis
                ret = dateFormat(dateTimeLabelFormat, value);

            } else if (i && numericSymbolDetector >= 1000) {
                // Decide whether we should add a numeric symbol like k (thousands) or M (millions).
                // If we are to enable this in tooltip or other places as well, we can move this
                // logic to the numberFormatter and enable it by a parameter.
                while (i-- && ret === UNDEFINED) {
                    multi = Math.pow(1000, i + 1);
                    if (numericSymbolDetector >= multi && numericSymbols[i] !== null) {
                        ret = numberFormat(value / multi, -1) + numericSymbols[i];
                    }
                }
            }

            if (ret === UNDEFINED) {
                if (mathAbs(value) >= 10000) { // add thousands separators
                    ret = numberFormat(value, 0);

                } else { // small numbers
                    ret = numberFormat(value, -1, UNDEFINED, ''); // #2466
                }
            }

            return ret;
        }
function ( ) { var axis = this . axis , value = this . value , categories = axis . categories , dateTimeLabelFormat = this . dateTimeLabelFormat , numericSymbols = defaultOptions . lang . numericSymbols , i = numericSymbols && numericSymbols . length , multi , ret , formatOption = axis . options . labels . format , // make sure the same symbol is added for all labels on a linear axis numericSymbolDetector = axis . isLog ? value : axis . tickInterval ; if ( formatOption ) { ret = format ( formatOption , this ) ; } else if ( categories ) { ret = value ; } else if ( dateTimeLabelFormat ) { // datetime axis ret = dateFormat ( dateTimeLabelFormat , value ) ; } else if ( i && numericSymbolDetector >= 1000 ) { // Decide whether we should add a numeric symbol like k (thousands) or M (millions). // If we are to enable this in tooltip or other places as well, we can move this // logic to the numberFormatter and enable it by a parameter. while ( i -- && ret === UNDEFINED ) { multi = Math . pow ( 1000 , i + 1 ) ; if ( numericSymbolDetector >= multi && numericSymbols [ i ] !== null ) { ret = numberFormat ( value / multi , - 1 ) + numericSymbols [ i ] ; } } } if ( ret === UNDEFINED ) { if ( mathAbs ( value ) >= 10000 ) { // add thousands separators ret = numberFormat ( value , 0 ) ; } else { // small numbers ret = numberFormat ( value , - 1 , UNDEFINED , '' ) ; // #2466 } } return ret ; }
The default label formatter. The context is a special config object for the label.
The default label formatter . The context is a special config object for the label .