2016-12-14 147 views
0

我想在d3日期將語言更改爲西班牙語。更改默認語言環境日期d3 v4

爲此在D3 V3可以使用

var format = { 
    "decimal": ".", 
    "thousands": "", 
    "days": ["Domingo", "Lunes", .....]} 

    var localeFormatter = d3.locale(format) 

但是現在D3 V4 d3.locale不見了。和

d3.timeFormatDefaultLocale(format) 

似乎什麼也不做,我不知道是bug還是什麼。

我不想格式化這個鏈接的時間D3 time-format。 我想要改變語言。 ?

我曾嘗試

d3.local(format) 
d3.timeFormatDefaultLocale(format) 
d3.timeFormatLocale(format) 

¿有人能幫助我在此...

回答

0

在D3 V4,你應該使用 d3.formatDefaultLocale(format)

-1

看起來你需要做的:

d3.timeFormatDefaultLocale(format); 

之前你聲明你的尺度,否則D3會將英文作爲默認值。