Eric Preston
Eric Preston

Reputation: 11

highcharts lang.resetZoom doesn't appear to work

I've read the API docs, search the google, but far as I can tell, setting

lang: {
  resetZoom: "foo"
}

doesn't work. I've localized other keys in lang and they take hold, but not resetZoom or resetZoomTitle. Using Highcharts 4.1.1

Here's a fiddle I modified: http://jsfiddle.net/66fch6t3/

$(function () {
    $('#container').highcharts({
        lang: {
            resetZoom: "reset me please"
        },
        chart: {
            zoomType: 'x',
            resetZoomButton: {
                theme: {
                    fill: 'white',
                    stroke: 'silver',
                    r: 0,
                    states: {
                        hover: {
                            fill: '#41739D',
                            style: {
                                color: 'white'
                            }
                        }
                    }
                }
            }
        },

        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },

        series: [{
            data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
        }]
    });
});

Upvotes: 1

Views: 386

Answers (1)

Halvor Holsten Strand
Halvor Holsten Strand

Reputation: 20536

This works if you do it through the Highcharts.setOptions function. For example:

Highcharts.setOptions({
    lang: {
        resetZoom: "reset me please"
    }
});


$('#container').highcharts({
   ...
}

See this JSFiddle demonstration for how it looks and works.

If you look at the API you'll see that lang appears under Highcharts.setOptions({ in the tree structure to the left, and not under $("#container").highcharts({.

Upvotes: 3

Related Questions