mathiasbynens / covid-19-vaccinations-germany

Historical data on COVID-19 vaccination doses administered in Germany, per state.
https://mathiasbynens.github.io/covid-19-vaccinations-germany/
MIT License
52 stars 10 forks source link

refactor: use default `shortenYAxisNumbers` feature #29

Closed scmmishra closed 3 years ago

scmmishra commented 3 years ago

This PR replaces the DOM hack for formatting numbers with the available shortenYAxisNumbers option.

Here's a preview of the change

image

P.S. Thanks for creating such an amazing project, I'm glad you found Frappe Charts useful

mathiasbynens commented 3 years ago

Thanks for the patch!

I didn’t know about this setting — would it be worth adding it to the docs?

Would you be open to a patch that changes the formatting to use Intl.NumberFormat instead? E.g. in English, there should be no space between the number and the M, for example (according to the Unicode CLDR).

mathiasbynens commented 3 years ago

Would you be open to a patch that changes the formatting to use Intl.NumberFormat instead? E.g. in English, there should be no space between the number and the M, for example (according to the Unicode CLDR).

Oh wow, looks like this is fixed in the latest frappe-charts@2.0.0-rc14 already! Great! I’ll upgrade to v2 as you suggested in #30. 👍

mathiasbynens commented 3 years ago

@scmmishra FYI, since updating to v2, JavaScript errors are getting logged to the DevTools Console:

draw.js:648 Uncaught TypeError: Cannot read property 'nodeName' of undefined
    at Object.bar (draw.js:648)
    at AxisChart.js:476
    at Array.map (<anonymous>)
    at r.value (AxisChart.js:473)
    at r.value (BaseChart.js:274)
    at r.value (BaseChart.js:268)
    at r.value (BaseChart.js:160)
    at ResizeObserver.boundDrawFn (BaseChart.js:97)