amcharts / dataloader

Apache License 2.0
25 stars 25 forks source link

Lang File not working #17

Closed danielslim closed 7 years ago

danielslim commented 7 years ago

try every possible way i could think of to load Lang Translation since there's no examples shown how to use it but none are working.

maertz commented 7 years ago

Besides loading the language file into your enviroment, you need to set the language in your chart instance.


var chart = AmCharts.makeChart("chartdiv", {
  ...
  "language": "fr",
  "dataLoader": {
  ...
  }
});

https://codepen.io/team/amcharts/pen/2a7230f641df4b11a0f29d0cc6850e85 http://docs.amcharts.com/3/javascriptcharts/AmChart#language

danielslim commented 7 years ago

THk, it works. When include the dataloader lang file, i get format error on console, i guess that's because chart lang instance not set. When i did set, nothing was changing which likely due to browser cache till i add version to force reload js file, or put the lang translation directly in html file which works as well.

maertz commented 7 years ago

Glad to hear it worked out for you. Regarding the issue, ensure to load the language file of the dataloader after the plugin itself otherwise it can't assign/add the new language to the plugin.