Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts DateTime Localization

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.

like image 969
chridam Avatar asked Sep 14 '11 15:09

chridam


1 Answers

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: ','             }       }   ); 
like image 146
JMarques Avatar answered Sep 28 '22 05:09

JMarques