How to set google chart API locale

2020-07-03 04:53发布

问题:

I want to set the language of the google chart API to a value. It currently uses the language of the browser visiting the page. How do I set it to the language of my application?

回答1:

See Google docs Loading Charts using a specific locale.

By default, the Google Chart libraries are loaded with the locale specified by the browser. You can override this default by explicitly specifying a locale in the loading parameters.

For example:

google.load('visualization', '1', {'packages':['corechart'], 'language': 'ja'});