Rumpelstinsk
Rumpelstinsk

Reputation: 3241

HighStock: Tooltip ignores the localization

I'm trying to localize a HighStock Chart: https://api.highcharts.com/highcharts/lang

However, It ignores the localization for week days:

Highcharts.getJSON('https://www.highcharts.com/samples/data/aapl-c.json', function (data) {
// Create the chart
Highcharts.stockChart('container', {
            lang: {
                    weekdays: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi','Jeudi', 'Vendredi', 'Samedi']
    },

    rangeSelector: {
        selected: 1
    },

    title: {
        text: 'AAPL Stock Price'
    },

    series: [{
        name: 'AAPL',
        data: data,
        tooltip: {
            valueDecimals: 2
        }
    }]
});

});

enter image description here

You can reproduce the problem here: https://jsfiddle.net/pcsxebgo/1/

Upvotes: 0

Views: 132

Answers (1)

ppotaczek
ppotaczek

Reputation: 39139

You need to set weekdays in setOptions method:

Highcharts.setOptions({
    lang: {
        weekdays: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi']
    },
});

Highcharts.stockChart('container', ...);

Live demo: https://jsfiddle.net/BlackLabel/v876okxh/

API Reference: https://api.highcharts.com/highstock/lang.weekdays

Upvotes: 1

Related Questions