title: How can I load multiple Chartjs charts with different data on the same page?
body: <p>I have a website and some charts built with chart js. The data for the charts is all in one file, <em>births.js</em>. Before, there were multiple pages, so to load the correct chart I used a function and if statement for each page</p>
  
  <pre><code>    function drawChart() {
         if (window.location.href.indexOf("scotland") &gt; -1) {
      } 
      else if(window.location.href.indexOf("index") &gt; -1){
      }
  </code></pre>
  
  <p>etc.</p>
  
  <p>I've now been tasked with having everything on one interactive page, so the indexOf will always just be <em>index</em>. Is there a way to rewrite the function so that I can load the different data on the same page?</p>