I need to translate my highcharts when the user selects a different language. I have a chartservice that listens to the translationService and assign the value received from translationService to downloadCSV attribute of chart. here is the code"
private downloadCsvText= '';
this._translateService.get('TL_DOWNLOAD_CSV').subscribe((res: string) => this.downloadCsvText=res);
Highcharts.setOptions({
global: { useUTC: false },
lang: {
noData: this.chartNoData,
downloadCSV: this.downloadCsvText
}
});
and in my methods that create the chart I have:
exporting: {
filename: 'MyChart',
buttons: {
contextButton: {
menuItems: ['downloadCSV']
}
},
csv: {
itemDelimiter: ';'
},
fallbackToExportServer: false
}
However, at the moment that user changes the language, the menuItems is the only thing that is not translated. Any guidance is appreciated.
I am using
- Angular 8
- "highcharts": "6.1.1"
- "highcharts-export-csv": "=1.4.8",
- "highcharts-pattern-fill": "3.0.3",