title: Uncaught TypeError: Cannot read property 'xAxis' of undefined Highcharts
body: <p>i try to make synchronize zoom from more than 2 charts, just like in this example <a href="http://jsfiddle.net/ZArZM/" rel="nofollow noreferrer">http://jsfiddle.net/ZArZM/</a></p>
  
  <p>The problem is the chart is showing but in console there is "Uncaught TypeError: Cannot read property 'xAxis' of undefined" and the synchronize not work either.</p>
  
  <p>This is my code.</p>
  
  <pre><code>        &lt;script type="text/javascript"&gt;
  
          $(function () {
              var chart1;
              var chart2;
  
  
          $.getJSON('http://sine.co.id/PHESIAK/laporan/getJSON.php', function (data) {
  
          Highcharts.setOptions({
              global: {
                  useUTC: false
              }
          });
  
          $(document).ready(function () {
                  chart1 = new Highcharts.StockChart({
                      chart: {
                          renderTo: 'container',
                      },      
  
  
                  title: {
                      text: 'Data Monitoring Uji Coba Fast',
                      style: {
                      color: 'black',
                      fontWeight: 'bold',
                      fontSize: '50px'
                  }
                  },
  
                  subtitle: {
                      text: 'Temperature Sensor Well Head 81',
                      style: {
                      color: '#3366AA',
                      fontSize: '30px'
                      }
                  },
  
                  xAxis: {
                      gapGridLineWidth: 0,
                      events: {
                              afterSetExtremes: function (event) {
                                  var xMin = event.min;
                                  var xMax = event.max;
                                  var ex = chart2.xAxis[0].getExtremes();
  
  
                                  if (ex.min != xMin || ex.max != xMax) chart2.xAxis[0].setExtremes(xMin, xMax, true, false);
                              }
                          }
                  },
  
                  rangeSelector: {
                      buttons: [{
                          type: 'hour',
                          count: 1,
                          text: '1h'
                      }, {
                          type: 'day',
                          count: 1,
                          text: '1D'
                      }, {
                          type: 'all',
                          count: 1,
                          text: 'All'
                      }],
                      selected: 1,
                      inputEnabled: false
                  },
  
                  series: [{
                      name: 'Fahrenheit',
                      type: 'area',
                      data: data,
                      gapSize: 5,
                      tooltip: {
                          valueDecimals: 2
                      },
                      fillColor: {
                          linearGradient: {
                              x1: 0,
                              y1: 0,
                              x2: 0,
                              y2: 1
                          },
                          stops: [
                              [0, '#003399'],
                              [1, '#3366AA']
                          ]
                      },
                      threshold: null
                  }]
              });
          });
          });
          });
                  &lt;/script&gt;
  
  
          &lt;script type="text/javascript"&gt;
  
          $.getJSON('http://sine.co.id/PHESIAK/laporan/getJsonPres.php', function (data1) {
  
  
          Highcharts.setOptions({
              global: {
                  useUTC: false
              }
          });
  
          $(document).ready(function () {
                  chart2 = new Highcharts.StockChart({
                      chart: {
                          renderTo: 'container1',
                      },  
  
  
                  title: {
                      text:  ''
                  },
  
                  subtitle: {
                      text: 'Pressure Sensor Well Head 81',
                      style: {
                      color: '#D43346',
                      fontSize: '30px'
                      }
                  },
  
                  xAxis: {
                      gapGridLineWidth: 0,
  
                      events: {
                              afterSetExtremes: function (event) {
                                  var xMin = event.min;
                                  var xMax = event.max;
                                  var ex = chart1.xAxis[0].getExtremes();
  
  
                                  if (ex.min != xMin || ex.max != xMax) chart1.xAxis[0].setExtremes(xMin, xMax, true, false);
                              }
                          }
                  },
  
                  rangeSelector: {
                      buttons: [{
                          type: 'hour',
                          count: 1,
                          text: '1h'
                      }, {
                          type: 'day',
                          count: 1,
                          text: '1D'
                      }, {
                          type: 'all',
                          count: 1,
                          text: 'All'
                      }],
                      selected: 1,
                      inputEnabled: false
                  },
  
                  series: [{
                      name: 'PSI',
                      type: 'area',
                      data: data1,
                      gapSize: 5,
                      tooltip: {
                          valueDecimals: 2
                      },
                      fillColor: {
                          linearGradient: {
                              x1: 0,
                              y1: 0,
                              x2: 0,
                              y2: 1
                          },
                          stops: [
                              [0, '#ad1a2c'],
                              [1, '#D43346']
                          ]
                      },
                      threshold: null
                  }]
              });
          });
          });
                  &lt;/script&gt;
  </code></pre>
  
  <p>any advice guys ? i think i'm stuck. Thank you for your attention.</p>