Default (scale) formatter #11566
peteruithoven
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently customizing the
formatter
option in 3 places:options.scales.y.ticks.callback
)Isn't there a way to set the default (numeric) formatter in one place?
Like we can set
chart.defaults.font
for example:https://www.chartjs.org/docs/latest/api/interfaces/Defaults.html#font
Or related for formatting we can set the default locale:
https://www.chartjs.org/docs/latest/api/interfaces/Defaults.html#locale
We can configure defaults per scale, but not it's general formatting:
https://www.chartjs.org/docs/latest/api/interfaces/Defaults.html#scales
The Linear Axis specific tick options > format option comes close, but is limited to ticks and the use of Intl.NumberFormat.
https://www.chartjs.org/docs/latest/axes/cartesian/linear.html#linear-axis-specific-tick-options
Maybe one default formatter doesn't make sense, since it probably depend on the scale type.
Why not a
formatter
per scale type, something I could set for the linear scale like:Or/and also have the
format: NumberFormatOptions
option, which is available for the ticks config, available for the scale in general.Beta Was this translation helpful? Give feedback.
All reactions