title: Highcharts: Comparing 2 lines with different dates
body: <p>I'm comparing 2 users of twitter on who receives the most tweets on a particular day, and put this in a line graph of Highcharts, the following mysql code I have:</p>
  
  <pre><code>&lt;?php 
  
  require('mysql_connect.php');
  
  $artist1 = $_POST['dj1'];
  $artist2 = $_POST['dj2'];
  $dates_result = mysqli_query($con,"SELECT DISTINCT(tweetDate) FROM tb_tweetDetails");
  while ($row = mysqli_fetch_array($dates_result)) {
  $dates[] = $row['tweetDate'];
  }
  $artist1_tweetsADay_result =    mysqli_query($con,"SELECT tweetDate,COUNT('tweetIds') AS 'amountTweets' FROM tb_tweetDetails WHERE tweetId IN 
                              (SELECT tweetId FROM tb_tweetLink LEFT JOIN tb_artists ON 
                              (tb_tweetLink.artistId = tb_artists.artistId) where artistName = '$artist1') GROUP BY tweetDate");
  while ($row = mysqli_fetch_array($artist1_tweetsADay_result)) {
  $artist1_tweetsADay_date[] = "'" . $row['tweetDate'] . "'";
  $artist1_tweetsADay_amount[] = $row['amountTweets'];
  }
  $artist1_tweetsADay_result =    mysqli_query($con,"SELECT tweetDate,COUNT('tweetIds') AS 'amountTweets' FROM tb_tweetDetails WHERE tweetId IN 
                              (SELECT tweetId FROM tb_tweetLink LEFT JOIN tb_artists ON 
                              (tb_tweetLink.artistId = tb_artists.artistId) where artistName = '$artist2') GROUP BY tweetDate");
  while ($row = mysqli_fetch_array($artist1_tweetsADay_result)) {
  $artist2_tweetsADay_date[] = "'" . $row['tweetDate'] . "'";
  $artist2_tweetsADay_amount[] = $row['amountTweets'];
  }
  
  
  ?&gt;
  </code></pre>
  
  <p>I use this to collect all the available dates I collected tweet data (so also from other then the selected 2 artists)</p>
  
  <p>Then I get the amount of tweets the user received that day, together with the date.
  This all works nicely, and the output is as I expected.</p>
  
  <p>Now when I put it in the graph, I put the array of the dates, as the xAxis Categories.
  And put the tweetAmount for both artists in the data inputs to create both lines.</p>
  
  <p>The problem is:</p>
  
  <p>Artist 1 has data on 06-04-2013,08-04-2013 &amp; 10-04-2013
  Artist 2 has data on 07-04-2013,08-04-2013, 09-04-2013 &amp; 10-04-2013 (so everyday that actually is in my database)</p>
  
  <p>Artist 2 would have his data of 07-04-2013 at 06-04-2013 (since that value comes first)
  Artist 1 &amp; 2 have 08-04-2013 under the categorie 07-04-2013 since that is the second available date.</p>
  
  <p>etc. etc.</p>
  
  <p>Is it possible I could use the dates array, to fix the arrays of the amount of tweets, so that every missing date would have 0 assigned to it so the line stays correct with the date.</p>