echarts [Feature] Can we freely decide between thousandSeparator and decimalSeparator?

1l5u6lss  于 4个月前  发布在  Echarts
关注(0)|答案(4)|浏览(96)

What problem does this feature solve?

I am a developer serving the Brazilian market, where thousandSeparator is '.' , decimalSeparator is ',', now it is possible to use formatter to reach the target, but it is not possible to configure it globally, which is a pain

https://github.com/apache/echarts/blob/master/src/util/format.ts#L32

What does the proposed API look like?

const opts = {
formatterConfig: {
thousandSeparator: ',',
decimalSeparator: '.',
},
}

wwodge7n

wwodge7n2#

Try registerLocale with /src/i18n/langPT-br.ts ?

Yes, langPT-br.ts is just a copywriting change, but the actual number display is still the standard in English, for example the number "1,000.99", in Brazil would be written as '1.000,99', I hope to achieve this effect

atmip9wb

atmip9wb4#

How about this Demo Code ?

Yes, but this requires specifying the formatter in each place where it is used, which is painful to maintain when there are many charts, so I hope there is a global configuration place

相关问题