2016-08-18 3 views
0

角度nvd3 yAxis2の表示を変更してもらえますか? 実際には、たとえば9000から9Kに表示を変更しようとしています。 私はそれがd3.formatPrefix(".1", 1e6)を使用して行うことができるかもしれないことは知っていますが、私はそれを作ることができませんでした。 ここではplunkerです。Angular nvd3 chartでKとMを表示するYaxis

答えて

1

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. 
関連する問題