title: Uncaught TypeError: Cannot read property '0' of undefined javascript error and with highcharts
body: <p>Straight Away to the point that I am downloading a PDF of chart where I got the above exception on browser console saying "Uncaught TypeError: Cannot read property '0' of undefined".</p>
  
  <p>Not sure why I am getting this error. I have other reports which are downloading good. But some times I  get this issue. Piece of code that i am running is below.</p>
  
  <p>I am exactly getting the issue at this line <code>window[theSelectedChart].exportChart({</code></p>
  
  <p>Can any one help me out there. Thanks in advance.</p>
  
  <pre><code>if(theSelectedChart == 'somechart') {
     if(Shortform.chartType == 'bubble'){
          var maxDays = Math.max.apply(Math, Shortform.activeDays);
          var minDays = Math.min.apply(Math, Shortform.activeDays);
          window[theSelectedChart].xAxis[0].setExtremes(minDays - 1, maxDays + 1);
      } else {
           window[theSelectedChart].xAxis[0].setExtremes(0, categoriesLength);  
      }
  } else { 
      window[theSelectedChart].xAxis[0].setExtremes(0, categoriesLength - 1);
  }
  window[theSelectedChart].exportChart({
      type: "application/pdf",
      url: 'export-chart/',
      filename: localizedShortformExportFilenames[key],
      sourceWidth:(categoriesLength * 12 &gt; 600) ? categoriesLength * 12 : 800,
  },{
      scrollbar : {
          enabled : false,
      },
      chart : {
           marginTop : getMarginTop(selectedThumbnail),
           spacingRight : 30,
      },
      title: {
           y:5,
      },
      subtitle : {
           y : 15
      },
  });
  </code></pre>