0

I need to change the language/locale for my Google Charts dashboard. I'm using the package react-google-charts for this project. There is a language parameter in its distribution file:

windowGoogleCharts.charts.load(version || "current", {
  packages: packages || ["corechart", "controls"],
  language: language || "en",
  mapsApiKey: mapsApiKey
});

filename: index.cjs.js

How can I get to it? To use this package in my projects all they give you is a <Chart /> component, and I'm assuming the library has been loaded by then.

Caio Mar
  • 2,344
  • 5
  • 31
  • 37

1 Answers1

1

I don't know if you ever found the answer, but after looking at the source code and a couple of trials and errors due to the lack of decent documentation, it seems you just need to pass the chartLanguage prop.

Something like that:

<Chart
    chartType='Calendar'
    data={data}
    options={options}
    chartLanguage={currentLanguage}
  />
Andrea Sciamanna
  • 1,404
  • 1
  • 15
  • 30