NumeralTickFormatter language de

Hey everyone,

I have a question to the NumeralTickFormatter. I am using it to format the y values / axis in my plot. I am developing an application in the german area, so I would like to change the value formatting to a german language-specific format. For example in german we write the number 10,000.00 like that: 10.000,00. So the comma and the dots are switched. When I change the language of the NumeralTickFormatter to ‘de’, it doesn’t change the format of the values of the y axis. How do I have to code it, that it will use the german way? Or is there a way where I can set the format to switch the commas and dots. When I use format=‘0,0.00’ it doens’t work.
Here is my code:

plot = figure(name='kwhPlot', x_axis_type='datetime', plot_width=1500, plot_height=500, title='kWh Plot', x_axis_label='Zeitpunkt', y_axis_label='[kWh]')
plot.xaxis.formatter = DatetimeTickFormatter(
            days=["%d.%m.%y %H:%M"],
            months=["%d.%m.%y %H:%M"],
            hours=["%d.%m.%y %H:%M"],
            minutes=["%d.%m.%y %H:%M"]
plot.yaxis.formatter = NumeralTickFormatter(language='de')

Thanks everyone!

When NumeralTickFormatter was added, the build/bundle system for BokehJS was very new lacking in features. It was not possible to ship or include the extra locale “packs” for the formatter. Things have improved, and it might now be possible to do that. But the work has never been done to date. I would suggest you open a GitHub Issue to request this as new feature development.

At present, you best option is probably to use CustomJSTickFormatter (formerly FuncTickFormatter in older versions) to format the ticks to your needs.

Thanks Bryan, I am gonna open an GitHub Issue and try out the CUstomJSTickFormatter for now.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.