score:1

Accepted answer
  1. You don't need to call redraw after setData:

     function update_chart2(xmin, xmax) {
       ...
       chart2.series[0].setData(new_data);
       // chart2.redraw(); - redraw is called in setData
     }
    

  1. You can update xAxis with plot-band options instead of removing and adding it.

     events: {
       selection: function (event) {
         ...
         if (event.xAxis) {
           xmin = event.xAxis[0].min;
           xmax = event.xAxis[0].max;
    
           this.xAxis[0].update(
             {
               plotBands: [
                 {
                   from: xmin,
                   to: xmax
                 }
               ]
             },
             false
           );
         }
         update_chart2(Math.floor(xmin) + 1, Math.floor(xmax) + 1);
       },
       ...
     }
    

API Reference:

https://api.highcharts.com/class-reference/Highcharts.Series#setData

https://api.highcharts.com/class-reference/Highcharts.Axis#update


Related Query

More Query from same tag