Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute function after zoom highcharts

Tags:

highcharts

Is it possible to execute a function after zoom on a chart in Highcharts ?

like image 693
Iker Vázquez Avatar asked Nov 05 '12 21:11

Iker Vázquez


1 Answers

Use the afterSetExtremes event:

    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
            'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
        events: {
            afterSetExtremes: function(event){
                if (this.getExtremes().dataMin < event.min)
                    alert("Zoomed in!");
            }
        }
    }

Here's a working example: http://jsfiddle.net/RcdfW/

like image 117
Greg Ross Avatar answered Sep 18 '22 01:09

Greg Ross