2016-08-18 2 views
0

각도 nvd3 yAxis2에서 디스플레이를 변경하는 데 도움을 주시겠습니까? 사실 예를 들어 9000에서 9K로 디스플레이를 변경하려고합니다. d3.formatPrefix(".1", 1e6)을 사용하여이 작업을 수행 할 수 있지만 그 작업을 수행 할 수 없다는 것을 알고 있습니다. 여기에Angular nvd3 차트에서 K 및 M 표시 Yaxis

답변

1

에 대해 plunker이면 d3.formatPrefix (". 1", 1e6)를 사용할 필요가 없습니다. D3의의 GitHub의 사이트에 언급 된 이미 correctd 형식 d3.format(',.2f')(d)을 사용하는 당신은 sf을 변경해야

The available type values are: 

e - exponent notation. 
f - fixed point notation. 
g - either decimal or exponent notation, rounded to significant digits. 
r - decimal notation, rounded to significant digits. 
s - decimal notation with an SI prefix, rounded to significant digits. 
% - multiply by 100, and then decimal notation with a percent sign. 
p - multiply by 100, round to significant digits, and then decimal notation with a percent sign. 
b - binary notation, rounded to integer. 
o - octal notation, rounded to integer. 
d - decimal notation, rounded to integer. 
x - hexadecimal notation, using lower-case letters, rounded to integer. 
X - hexadecimal notation, using upper-case letters, rounded to integer. 
c - converts the integer to the corresponding unicode character before printing. 

(none) - like g, but trim insignificant trailing zeros. 
관련 문제