title: creating line chart using json and mysql php
body: <p>Am creating a line chart using data from database,but i only get one single line as count vs date.
  I want username as multiple lines.I searched lot for to get but cant able to solve my issue.In line chart i want date as x axis,count as y axis and multiple lines as username.Can anyone help me to get this.I encoded the data to json format.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
   $(document).ready(function(){
          $.ajax({
              url:"get_line_chart.php",
              type:'POST',
              success: function(output_string){ 
  
      var data = new google.visualization.DataTable();
          data.addColumn('string', 'Topping');
          data.addColumn('number', 'count');
      var json_data = $.parseJSON(output_string);
          var result = [];
      for(var i in json_data)
      result.push([i, json_data [i]]);
            data.addRows(result);
          // Set chart options
          var options = {'title':'',
                         'width':500,
                         'height':400};
          // Instantiate and draw our chart, passing in some options.
              var line= new google.visualization.LineChart(document.getElementById('line_chart'));
                 line.draw(data, options);
                  } 
              }); 
  
        });
        google.load('visualization', '1', {'packages':['corechart']});
    &lt;/script&gt;
  </code></pre>
  
  <p>mysql table structure </p>
  
  <pre><code>username   count    date
  aaa         1       2014-05-07
  aaa         1       2014-05-21
  bbb         3       2014-05-01
  bbb         4       2014-05-15
  bbb         5       2014-05-14
  ccc         7       2014-05-01
  ccc         5       2014-05-09
  </code></pre>
  
  <p>Sample JSON data:</p>
  
  <pre><code>{
      "2014-05-07": 10,
      "2014-05-27": 2,
      "2014-05-28": 3,
      "2014-05-23": 3,
      "2014-05-30‌​": 2,
      "2014-05-09": 11,
      "2014-05-16": 5,
      "2014-05-26": 2,
      "2014-05-22": 2,
      "2014-05-05": 2,
      "‌​2014-05-06": 1,
      "2014-05-08": 5,
      "2014-05-12": 5,
      "2014-05-13": 3,
      "2014-05-14": 6,
      "2014-0‌​5-19": 2
  }
  </code></pre>