node_modules/echarts/lib/util/format.js
/**
 * Make value user readable for tooltip and label.
 * "User readable":
 *     Try to not print programmer-specific text like NaN, Infinity, null, undefined.
 *     Avoid to display an empty string, which users can not recognize there is
 *     a value and it might look like a bug.
 */
Make value user readable for tooltip and label.
"User readable":
Try to not print programmer-specific text like NaN, Infinity, null, undefined.
Avoid to display an empty string, which users can not recognize there is
a value and it might look like a bug.
Make value user readable for tooltip and label . " User readable " : Try to not print programmer - specific text like NaN Infinity null undefined . Avoid to display an empty string which users can not recognize there is a value and it might look like a bug .
function makeValueReadable(value, valueType, useUTC) {
  var USER_READABLE_DEFUALT_TIME_PATTERN = '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}';
  function stringToUserReadable(str) {
    return str && zrUtil.trim(str) ? str : '-';
  }
  function isNumberUserReadable(num) {
    return !!(num != null && !isNaN(num) && isFinite(num));
  }
  var isTypeTime = valueType === 'time';
  var isValueDate = value instanceof Date;
  if (isTypeTime || isValueDate) {
    var date = isTypeTime ? parseDate(value) : value;
    if (!isNaN(+date)) {
      return timeFormat(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);
    } else if (isValueDate) {
      return '-';
    } 
  }
  if (valueType === 'ordinal') {
    return zrUtil.isStringSafe(value) ? stringToUserReadable(value) : zrUtil.isNumber(value) ? isNumberUserReadable(value) ? value + '' : '-' : '-';
  } 
  var numericResult = numericToNumber(value);
  return isNumberUserReadable(numericResult) ? addCommas(numericResult) : zrUtil.isStringSafe(value) ? stringToUserReadable(value) : typeof value === 'boolean' ? value + '' : '-';
}
function makeValueReadable ( value , valueType , useUTC ) { var USER_READABLE_DEFUALT_TIME_PATTERN = '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}' ; function stringToUserReadable ( str ) { return str && zrUtil . trim ( str ) ? str : '-' ; } function isNumberUserReadable ( num ) { return ! ! ( num != null && ! isNaN ( num ) && isFinite ( num ) ) ; } var isTypeTime = valueType === 'time' ; var isValueDate = value instanceof Date ; if ( isTypeTime || isValueDate ) { var date = isTypeTime ? parseDate ( value ) : value ; if ( ! isNaN ( + date ) ) { return timeFormat ( date , USER_READABLE_DEFUALT_TIME_PATTERN , useUTC ) ; } else if ( isValueDate ) { return '-' ; } } if ( valueType === 'ordinal' ) { return zrUtil . isStringSafe ( value ) ? stringToUserReadable ( value ) : zrUtil . isNumber ( value ) ? isNumberUserReadable ( value ) ? value + '' : '-' : '-' ; } var numericResult = numericToNumber ( value ) ; return isNumberUserReadable ( numericResult ) ? addCommas ( numericResult ) : zrUtil . isStringSafe ( value ) ? stringToUserReadable ( value ) : typeof value === 'boolean' ? value + '' : '-' ; }
Make value user readable for tooltip and label.
Make value user readable for tooltip and label .
// In other cases, continue to try to display the value in the following code. // By default.