1

How do I make a Google Chart axis to use day of the week names in different languages (e.g. in German).

For tooltip I use

var formatter = new google.visualization.DateFormat({ pattern: 'EEEE, dd.MM.YYYY' });

Here it produces Tuesday, 31.03.2020, and I would like to see Dienstag, 31.03.2020

For axis I use option

hAxis: { format: "EE, dd/MM" }

This produces Tu, 31/03, and I would like to see Di, 31/03

What is the way to do it please?

WhiteHat
  • 59,912
  • 7
  • 51
  • 133
Matti
  • 13
  • 4
  • I think you should look at http://userguide.icu-project.org/formatparse/datetime around DateTimePatternGenerator, as https://developers.google.com/chart/interactive/docs/reference#dateformat say they use that ICU format... – B. Go Mar 31 '20 at 21:51
  • Thanks for the suggestion! Unfortunately Formatter DateFormat does only support formatType, pattern and timeZone options, there is no possibility to change locale or use locale of browser settings. ICU would be capable of doing it, but I don't know how to apply it in Google visualization. – Matti Apr 01 '20 at 07:32

1 Answers1

0

try setting the language option when loading google charts...

google.charts.load('current', {
  packages: ['corechart'],
  language: 'de'
});
WhiteHat
  • 59,912
  • 7
  • 51
  • 133