numberFormatter (chart properties)

차트 안의 모든 숫자(축 라벨, 툴팁, 데이터 라벨 등) 표시 형식을 정하는 함수를 설정합니다.
함수는 숫자(number)와 소수 자릿수(decimals) 등을 인자로 받아 문자열을 반환합니다. 기본 형식에 단위를 붙이려면 numberFormat 메서드를 함께 사용합니다.
축 라벨이 천 단위 이상이면 함수 결과 뒤에 k, M 같은 약어가 붙습니다 (예: 2원k). 약어를 쓰지 않으려면 IBLANG의 numericSymbols를 null로 설정합니다.

Info

name type required(default) description
numberFormatter function 선택(undefined) 차트 안의 모든 숫자(축 라벨, 툴팁, 데이터 라벨 등) 표시 형식을 정하는 함수를 설정합니다.

Example

myChart.setOptions({
  chart: {
    type: "column",
    numberFormatter: function (number, decimals) {
      return myChart.numberFormat(number, decimals) + "점";  // 모든 숫자 뒤에 "점"
    }
  },
  series: [{
    name: "평가",
    data: [60, 40, 20, 80]
  }]
}, {
  append: true,
  redraw: true
});

예제에서 사용한 numberFormat 메서드는 7.3.1.32부터 제공됩니다.

제공 버전

version desc
7.3.0.0