I am trying to retrieve data for Flot charts but I don't know how the process goes. I have created a query, grouped the data but don't know how to display them.
Below is the code!
           <h3 class="box-title">Area Chart</h3>
           <div class="box-body">
              <div class="chart">
                <canvas id="areaChart" style="height:300px"></canvas>
              </div>
            </div>
<?php
$dataset1 = array();
$sqlbar = mysql_query("SELECT level_apply AS level, COUNT(id) AS 'count' FROM application GROUP BY level");
while($row = mysql_fetch_assoc($sqlbar))
    {
        $dataset1[] = array (intval($row['level']),intval($row['count']));
    }
?>  
    {{ HTML::script('/admin/assets/js/jquery-2.2.3.min.js') }}
<script>
  $(function () {
    var dataset1 = <?php echo json_encode($dataset1); ?>;
    $.plot($("#areaChart"), [dataset1]); });
</script>
 
    