Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
98
rated 0 times [  101] [ 3]  / answers: 1 / hits: 36605  / 13 Years ago, wed, september 14, 2011, 12:00:00

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:



Highcharts.setOptions({
lang: {
months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
weekdays: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi']
} });


but the chart still displays the default values.



jsFiddle with the problem.


More From » jquery

 Answers
17

Just to complete a little bit this topic:



All the options related with language are available here



A full Portuguese example:



var highchartsOptions = Highcharts.setOptions({
lang: {
loading: 'Aguarde...',
months: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
weekdays: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'],
shortMonths: ['Jan', 'Feb', 'Mar', 'Abr', 'Maio', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
exportButtonTitle: Exportar,
printButtonTitle: Imprimir,
rangeSelectorFrom: De,
rangeSelectorTo: Até,
rangeSelectorZoom: Periodo,
downloadPNG: 'Download imagem PNG',
downloadJPEG: 'Download imagem JPEG',
downloadPDF: 'Download documento PDF',
downloadSVG: 'Download imagem SVG'
// resetZoom: Reset,
// resetZoomTitle: Reset,
// thousandsSep: .,
// decimalPoint: ','
}
}
);

[#90104] Tuesday, September 13, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kieraelsies

Total Points: 718
Total Questions: 103
Total Answers: 104

Location: England
Member since Sun, May 21, 2023
1 Year ago
;