Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing column chart axis label rounding errors #113

Closed
wants to merge 1 commit into from

Conversation

bchartoff
Copy link

A change we made in the soon-to-be-open sourced (the next few days, it'll be in https://github.com/washingtonpost/datawrapper) datawrapper fork, that addresses rounding errors on column chart axes.

There's some inconsistency between how column chart and grouped-column chart
is structred, looking at the horzGrid is just one example (compare how theme is defined),
__gridlabels vs tickLabels, etc.)

The fundamental challenge here was parsing out when formatValue in dw.js/src/dw.chart.js was used (which accepts a boolean rounding arg), and when formatValue defined in the plug was used (which just overrides the former func and replaces it with columnFormatter in /dw.js/dw-2.0.js)

…t'll be in https://github.com/washingtonpost/datawrapper) datawrapper fork, that addresses rounding errors on column chart axes.

There's some inconsistency between how column chart and grouped-column chart
is structred, looking at the `horzGrid` is just one example (compare how `theme` is defined),
`__gridlabels` vs `tickLabels`, etc.)

The fundamental challenge here was parsing out when `formatValue` in dw.js/src/dw.chart.js was used (which accepts a boolean rounding arg), and when `formatValue` defined in the plug was used (which just overrides the former func and replaces it with `columnFormatter` in `/dw.js/dw-2.0.js`)
@ilokhov ilokhov closed this Dec 3, 2019
gka pushed a commit that referenced this pull request Sep 26, 2021
* use IconDisplay in IconButton, new style, docs & storybook

* install latest @datawrapper/icons

* lint

* set asset url

Co-authored-by: David Kokkelink <david@datawrapper.de>
gka pushed a commit that referenced this pull request Dec 5, 2021
* use IconDisplay in IconButton, new style, docs & storybook

* install latest @datawrapper/icons

* lint

* set asset url

Co-authored-by: David Kokkelink <david@datawrapper.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants