title: Chartjs.org Chart only displaying in one page
body: <p>My charts works well on the same page but when I put on different pages, only the first one works fine.</p>
  
  <p>ex:
  Page1.html</p>
  
  <pre><code>&lt;div class="wrapper"&gt;
    &lt;canvas id="pieChart" width="200px" height="200px"&gt;&lt;/canvas&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>Page2.html</p>
  
  <pre><code> &lt;div class="wrapper"&gt;
    &lt;canvas id="lineChart" width="200px" height="200px"&gt;&lt;/canvas&gt; 
   &lt;/div&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre>
  
      //page1.html
      //piechart
      var pieVar = {
          type: 'pie',
          data: {
          labels: ["Yes", "No"],
          datasets: [
              {
                  data: [60, 40],
                  backgroundColor: [
                      "#FF6384",
                      "#36A2EB"
                  ],
                  hoverBackgroundColor: [
                      "#FF6384",
                      "#36A2EB"
                  ]
              }
          ]
      },
          options: {
              scales: {
                  xAxes: [{
                      display: true
                  }]
              }
          }
      }
  
      //page2.html
      //line chart
      var lineVar = {
          type: 'line',
          data: {
          labels: ["January", "February", "March", "April", "May", "June", "July"],
          datasets: [
              {
                  label: "My First dataset",
                  fill: true,
                  lineTension: 0.2,
                  backgroundColor: "rgba(75,192,192,0.4)",
                  borderColor: "rgba(75,192,192,1)",
                  borderCapStyle: 'butt',
                  borderDash: [],
                  borderDashOffset: 0.0,
                  borderJoinStyle: 'miter',
                  pointBorderColor: "rgba(75,192,192,1)",
                  pointBackgroundColor: "#fff",
                  pointBorderWidth: 1,
                  pointHoverRadius: 10,
                  pointHoverBackgroundColor: "rgba(255,0,0,1)",
                  pointHoverBorderColor: "rgba(255,0,0,1)",
                  pointHoverBorderWidth: 2,
                  pointRadius: 1,
                  pointHitRadius: 10,
                  data: [65, 59, 80, 81, 56, 55, 40],
                  spanGaps: false,
              }
          ]
      },
          options: {
              scales: {
                  xAxes: [{
                      display: true
                  }]
              }
          }
      }
  
      window.onload = function(){
          //piechart
          var pieCtx =  document.getElementById("pieChart");
          var myPieChart = new Chart(pieCtx, pieVar);
          //linechart
          var lineCtx =  document.getElementById("lineChart");
          var myLineChart = new Chart(lineCtx, lineVar);
      };
  
  </pre>
  
  <p>In this codepen works fine because it's the same page..
  <a href="http://codepen.io/NemesisTeufel/pen/QpdNZW?editors=1010" rel="nofollow noreferrer">CODEPEN</a></p>