title: Highcharts columnrange date chart
body: <p>My goal is to make a chart that tracks user activity.  I want it to plot when they first logged on, and when they last logged on.</p>
  
  <p>The data I pass into this function (<code>var refarray = [...data here...]</code>) is in string format, meaning I need to parse the dates given to me from the database into a date format, or so I thought. Below you will see my attempt.</p>
  
  <pre><code>function hc_first_last_logon(selector, refarray){
  var categories = [];
  var Dat = [];
  
  for(var i = 0; i&lt;refarray.length; i++){    // store all user names and data
      categories.push(refarray.name)
      Dat.push([Date.parse(refarray.FirstLogon), Date.parse(refarray.LastLogon)])
  }
  //console.log(Dat) returns date time objects as expected
  var def = {
      chart: { type: 'columnrange', inverted: true },
      legend: { enabled: false},
      title:{ text: "First and Last Log-on"},
      xAxis:{ categories: categories, title:{text: "User"}},
      yAxis:{ type: 'datetime' },
      series:[{name: "First and Last Log-on", data: Dat}]
  };
  var div = $('#' + selector);
  console.log(div);
  div.highcharts(def);
  return def;}
  </code></pre>
  
  <p>My intent is for this chart to be versatile, allowing me to choose any number of different users, and get the chart when I click a refresh button on my html page (it queries the database and sends the data to this function).</p>
  
  <p>I suspect that my issue has to do with the date variable, <code>Dat</code>, as it appears that the string and date variable types are not acceptable data inputs for highcharts.  </p>
  
  <p>Here's an included screen shot of the errors that I am getting in the returned code.  The 10x2 matrix is pretty much all the same, so I'll only include one row.  Error #17 corresponds to unacceptable data type, which confirms my suspicions.</p>
  
  <p><a href="http://i.stack.imgur.com/VZTND.png" rel="nofollow">Console Results</a></p>
  
  <p>Any suggestions?</p>
  
  <p>UPDATE:  I included highcharts-more.js, and now got rid of the error mentioned above.  The date ranges are still a bit off.  Below is an image of what's going on now.</p>
  
  <p><a href="http://i.stack.imgur.com/6xYqw.png" rel="nofollow">Current Chart Situation</a></p>