echarts icon indicating copy to clipboard operation
echarts copied to clipboard

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

Open faner11 opened this issue 2 years ago • 6 comments

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: '.', }, }

faner11 avatar Jun 02 '23 10:06 faner11

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

faner11 avatar Jun 03 '23 10:06 faner11

How about this Demo Code ? image

helgasoft avatar Jun 03 '23 20:06 helgasoft

How about this Demo Code ? image

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

faner11 avatar Jun 04 '23 12:06 faner11

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] avatar Jun 03 '25 21:06 github-actions[bot]

Still Needed

faner11 avatar Jun 04 '25 09:06 faner11

Still needed

diegoamc avatar Jun 30 '25 18:06 diegoamc