Can someone point me to how I can localize the date-related Strings which are hardcoded in the HighCharts js-file. For instance, instead of the default ‘Feb’ date label in the x-axis, I would want the chart to display the localized value ‘Fév’. I tried implementing the localization by setting the options on the language object before the chart is instantiated:
JavaScript
x
6
1
Highcharts.setOptions({
2
lang: {
3
months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
4
weekdays: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi']
5
} });
6
but the chart still displays the default values.
jsFiddle with the problem.
Advertisement
Answer
Just to complete a little bit this topic:
All the options related with language are available here
A full Portuguese example:
JavaScript
1
23
23
1
var highchartsOptions = Highcharts.setOptions({
2
lang: {
3
loading: 'Aguarde...',
4
months: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
5
weekdays: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'],
6
shortMonths: ['Jan', 'Feb', 'Mar', 'Abr', 'Maio', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
7
exportButtonTitle: "Exportar",
8
printButtonTitle: "Imprimir",
9
rangeSelectorFrom: "De",
10
rangeSelectorTo: "Até",
11
rangeSelectorZoom: "Periodo",
12
downloadPNG: 'Download imagem PNG',
13
downloadJPEG: 'Download imagem JPEG',
14
downloadPDF: 'Download documento PDF',
15
downloadSVG: 'Download imagem SVG'
16
// resetZoom: "Reset",
17
// resetZoomTitle: "Reset,
18
// thousandsSep: ".",
19
// decimalPoint: ','
20
}
21
}
22
);
23