Google Chart geochart language option not working

271 views
Skip to first unread message

Daniel Zaiser

unread,
Jan 19, 2021, 9:24:23 AM1/19/21
to Google Visualization API
Hello, 
I want to display country names from a table with german names, but when i try to display the google visualization api will always call the countries_en.js even tho i set language: 'de' on load.
What can i do?
I checked and there is a countries_de.js, so there should be a way to get this.
My Example-Code:

google.charts.load('current', {
  'packages': ['geochart'],
  'mapsApiKey': 'AIzaSyAr8MShV9ZEQVu2ah-aGv5cmg9t4FhftZg',
  'language': 'de'
});
google.charts.setOnLoadCallback(() => {
  const dataCountries = google.visualization.arrayToDataTable([
    ['Country', 'Popularity'],
    ["Deutschland", 333],
    ["Spanien", 249],
    ["Griechenland", 119],
    ["Italien", 99],
    ["Österreich", 55],
    ["Türkei", 47],
    ["Niederlande", 46]
  ]);
  const options = {
    region: '150',
    enableRegionInteractivity: true,
    displayMode: 'regions',
    resolution: 'countries'
  };
  this.chart = new google.visualization.GeoChart(this.chartEl.nativeElement);
  this.chart.draw(dataCountries, options);
}

This code is inside my angular function, it displays the map, but it won't color, because countries obv not in countries_en.js :(

network tab, chrome devtools:
Bildschirmfoto 2021-01-19 um 15.22.57.png


Also idk if related: I am receiving a Geocode error-message, asking me to enable billing, i sure hope its unrelated...

imageedit_3_7896309033.jpg

Daniel Zaiser

unread,
Jan 19, 2021, 9:27:40 AM1/19/21
to Google Visualization API
for reference, if i change the country names in my table to the english equivalent, it will properly render the map as expected:
Bildschirmfoto 2021-01-19 um 15.26.43.png

Thomas W

unread,
Nov 30, 2023, 8:37:17 AM11/30/23
to Google Visualization API
Hi Daniel,
ich hab das selbe Problem. 
  google.charts.load('current', {
        'language': 'de',
'packages':['geochart'].... 
wird ignoriert.
Hast du da eine Lösung?
lg Thomas


Hi Daniel,
I have the same problem.
google.charts.load('current', {
'language': 'de',
'packages':['geochart']....
is ignored.
Do you have a solution?
lg Thomas


Daniel LaLiberte

unread,
Nov 30, 2023, 12:15:36 PM11/30/23
to google-visua...@googlegroups.com
Hi Thomas,

It looks like you are doing the right thing, so I would suspect this
is a bug in the GeoChart. You might try the 'upcoming' version, which
was updated last spring (never released) to use the updated
geochartVersion and regioncoderVersion. See the configuration options
at: https://developers.google.com/chart/interactive/docs/gallery/geochart#configuration-options


On Thu, Nov 30, 2023 at 8:37 AM Thomas W <thomas...@gmail.com> wrote:
>
> Hi Daniel,
> ich hab das selbe Problem.
> google.charts.load('current', {
> 'language': 'de',
> 'packages':['geochart']....
> wird ignoriert.
> Hast du da eine Lösung?
> lg Thomas
>
>
> Hi Daniel,
> I have the same problem.
> google.charts.load('current', {
> 'language': 'de',
> 'packages':['geochart']....
> is ignored.
> Do you have a solution?
> lg Thomas
>
>
> Daniel Zaiser schrieb am Dienstag, 19. Januar 2021 um 15:27:40 UTC+1:
>>
>> for reference, if i change the country names in my table to the english equivalent, it will properly render the map as expected:
>>
>>
>>> Also idk if related: I am receiving a Geocode error-message, asking me to enable billing, i sure hope its unrelated...
>>>
> --
> You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ec406278-050e-43a4-b311-7cd5fa357895n%40googlegroups.com.



--

• Daniel LaLiberte

• SWE

• Cambridge MA

• dlali...@Google.com
Reply all
Reply to author
Forward
0 new messages