title: Adding value to high chart's Spline Graph from mysql
body: <p>My selected rows from query is,</p>
  
  <pre><code> ## Selected rows from query ##
          id             rank          Date
          2               5           2016-03-15    
          4               3           2016-04-15
          5               2           2016-04-15
  </code></pre>
  
  <p>My Query is, </p>
  
  <p>$touserid = '26';
  $teamcode = "RXqYLM";</p>
  
  <p>Query = select *,SUM(rank_emotions) as total from assign_emotions where to_user_id='$touserid' and teamcode='$teamcode';</p>
  
  <p>So, i got total perfectly but the problem is i want show months in the graph so for months i done.</p>
  
  <pre><code>              $date = $row['date'];
                $time = strtotime($date);
                $month = date("F",$time);  
  </code></pre>
  
  <p><strong>So From this code i got month now the problem is i have to combine both and i want monthwise rank of user and show it in Graph.</strong></p>
  
  <p>I tried below code, 
  but i want monthwise rank it means if in one month if a user has more than one rank that those values must be sum so in datafield's example for April month the rank is 8.  </p>
  
  <pre><code> &lt;?php 
        include("header.php");
        include("config.php"); 
        $touserid = '26';
        $teamcode = "RXqYLM";
        $name = $_POST['teammembername'];
        if(isset($_POST['teammembername']))
        {
            $touserid = '26';
            $teamcode = "RXqYLM";
            $name = $_POST['teammembername'];
  
            $res = $conn -&gt; query("select *,SUM(rank_emotions) as total, MONTH(date) as month from assign_emotions where to_user_id='$touserid' and teamcode='$teamcode' GROUP BY MONTH(date)");
            $counter = 0;
             while($row = mysqli_fetch_assoc($res))
            {
              echo $row['month'];
            }
          }
  ?&gt;    
  
  &lt;!DOCTYPE html&gt;
      &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;&lt;/title&gt;
          &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="https://code.highcharts.com/highcharts.js"&gt;&lt;/script&gt;
          &lt;script src="https://code.highcharts.com/highcharts-more.js"&gt;&lt;/script&gt;
          &lt;script src="https://code.highcharts.com/modules/exporting.js"&gt;&lt;/script&gt;
      &lt;/head&gt; 
      &lt;body&gt;
      &lt;script&gt;
      $(function () {
          $('#container').highcharts({
              chart: {
                  type: 'spline'
              },
              title: {
                  text: 'KPI Chart Monthwise'
              },
              xAxis: {
                  categories: ['Jan', 'Feb', 'March', 'April', 'May','June', 'July', 'August', 'September', 'October', 'Nov', 'December']
              },
              credits: {
                  enabled: false
              },
              series: [{
                  name: '&lt;?php echo "bhavin"; ?&gt;',
                  data: [&lt;?php if($row['month'] == '1')
                      {
                         echo $row['total'];
                      }
                      else
                      {
                          echo '0';
                      } ?&gt;, 3, 4, 7, 2, 0, 0, 0, 0, -2, 0 ,0]
              }]
          });
      });
      &lt;/script&gt;
      &lt;div id="container" style="height: 400px; margin: auto; min-width: 310px; max-width: 600px"&gt;&lt;/div&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>if there is any doubt in the question please let me know .</p>