title: How to make multiple charts using highcharts in a loop?
body: <p>This is the relevant code I have:</p>
  
  <pre><code>        &lt;script&gt;
              titles = &lt;?php echo json_encode($graphTitles)?&gt;;
              //Loop through the graphs
              for (var graphNO = 0; graphNO &lt; titles.length; graphNO++)
              {                               
                 //CREATE NEW CONTAINER
                  var container = document.createElement('div'); 
                  document.body.appendChild(container);er);
  
                  dates = &lt;?php echo json_encode($recivedDates);?&gt;[titles[graphNO]];
                  //I EXTRACT A FEW  MORE ARRAYS THE SAME METHOD
                $(function () 
                  {
                    $(container).highcharts({
                        title: {
                            text: titles[graphNO]
                        },
                        xAxis: {
                            categories: dates
                        },
                        series: [{
                            type: 'column',
                            color: 'gold',
                            name: 'Created Issues',
                            data: createdIssues.map(Number)
                        }, 
                         //MORE COLUMN'S AND SOME SPLINES. IT ALL WORKS AS EXPECTED
                    });
                  });
              }
          &lt;/script&gt;
  </code></pre>
  
  <p>I didn't want to post all the code and just make it messy, what I expected this code to do is:</p>
  
  <p>graphNO has the value of 2, I thought it would loop through twice (which it does), make a container for each loop (which it does), then draw a different graph for each loop it does in the container it just made (but instead it just draws the second graph).</p>
  
  <p>I don't know whats wrong, but any ideas on how to fix this, or any ideas on how to make multiple graphs in a loop would be great help.</p>
  
  <p>Also, this is the first site I'm making so I haven't used javascript, php, or html for more then a day, so sorry if it's really obvious, I couldn't find anything on this though.</p>