Search code examples
highchartshighmaps

Highcharts Drilldown fail


I'm using highcharts maps drilldown like this JSFiddle
The problem is that when i drilldown, i change the DataClasses like this

chart.update({
    colorAxis: {
        dataClasses: [{
            to: 5000
        }, {
            from: 5000,
            to: 6000
        }, {
            from: 6000
        }]
    }
});

And it works perfectly and when i drillUp i have this

drillup: function () {
    this.setTitle(null, { text: 'General' });
    this.colorAxis[0].update({
        colorAxis: {
            dataClasses: [{
                to: 200000
            }, {
                from: 200000,
                to: 350000
            }, {
                from: 350000
            }]
        }
    });
}

All works perfect but when i try to drilldown again it doesn't work. any idea to solve this problem? or how to change the data classes in a different way?


Solution

  • I got the desired result just by adding "False" to the redraw option of Highcharts, because it is by default set true

    update(Object options, Boolean redraw)

    I had to read the documentation. Here is the answer in the docs.

    I'm using Highcharts JS v5.0.12 (2017-05-24).

    Here is the code

    drillup: function() {
        this.update({
            colorAxis: {
                dataClasses: [{
                    to: 200000
                }, {
                    from: 200000,
                    to: 350000
                }, {
                    from: 350000
                }]
            }
        }, false);
    }