title: VM5111:1249 Uncaught TypeError: Cannot read property 'x' of null
body: <p>Hello i have this error and cannot seem to understand it. I am learning google pie charts and was able to use the sample provided by google api. But now i intend to hover the div and make the piechart explode. when the mouse leaves the div it returns to a normal piechart. But having an error when i hover over the div.
  Below is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
  
      google.charts.load('current', {'packages':['corechart']});
      google.charts.setOnLoadCallback(drawChart);
      function drawChart() {
      
          var data = google.visualization.arrayToDataTable([
              ['Task', 'Hours per Day'],
              ['Work',     11],
              ['Eat',      2],
              ['Commute',  2],
              ['Watch TV', 2],
              ['Sleep',    7]
          ]);
        
          var options = {
              title: 'My Daily Activities'
          };
        
          var chart = new google.visualization.PieChart(document.getElementById('piechart'));
        
          chart.draw(data, options);
      }
      
      
      var div1 = document.getElementById('piechart');
      
      $(div1).mouseover(function(){
          google.charts.setOnLoadCallback(drawChart1);
      });
  
      function drawChart1() {
          var data = google.visualization.arrayToDataTable([
              ['Language', 'Speakers (in millions)'],
              ['Assamese', 13], ['Bengali', 83], ['Bodo', 1.4],
              ['Dogri', 2.3], ['Gujarati', 46], ['Hindi', 300],
              ['Kannada', 38], ['Kashmiri', 5.5], ['Konkani', 5],
              ['Maithili', 20], ['Malayalam', 33], ['Manipuri', 1.5],
              ['Marathi', 72], ['Nepali', 2.9], ['Oriya', 33],
              ['Punjabi', 29], ['Sanskrit', 0.01], ['Santhali', 6.5],
              ['Sindhi', 2.5], ['Tamil', 61], ['Telugu', 74], ['Urdu', 52]
          ]);
        
          var options = {
              title: 'Indian Language Use',
              legend: 'none',
              pieSliceText: 'label',
              slices: {  4: {offset: 0.2},
                        12: {offset: 0.3},
                        14: {offset: 0.4},
                        15: {offset: 0.5},
              },
          };
        
          var chart = new google.visualization.PieChart(document.getElementById('piechart'));
          chart.draw(data, options);
      }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="piechart" style="width: 900px; height: 500px;"&gt;&lt;/div&gt;
  
  &lt;!-- jQuery library --&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;!-- Latest compiled JavaScript --&gt;
  &lt;script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"&gt;&lt;/script&gt;
  
   &lt;script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"&gt;&lt;/script&gt;
   &lt;script type="text/javascript" src="pie_chart.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>