here's my code

<?php
$A = $_GET['date1'];
$B = $_GET['date2'];
$C = $_GET['cat'];

$connect = mysqli_connect("localhost","root","","csv");
$query = "SELECT * FROM file WHERE date>'$A' and date<'$B' ";
$result = mysqli_query($connect,$query);
$chart_data = '';

while($row = mysqli_fetch_array($result)){
$chart_data = "{date:'".$row["date"]."' , $C:".$row["$C"]."},";
}

$chart_data = substr($chart_data, 0, -2);
?>

<!DOCTYPE html>
<html>
 <head>
  <title></title>
 <style>
  <link rel="stylesheet" 
href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">
  <script 
src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
  <script 
src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
  <script 
src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>
 body {
    font-family: Arial;
    width: 550px;
}

 </style> 


 </head>
 <body>
  <br /><br />
  <div class="container" style="width:900px;">
   <h2 align="center"><?php echo"The chart shows the $C data display" 
?></h2>
   <h3 align="center"><?php echo"$A to $B" ?></h3>   
   <br /><br />
   
   
   <div id="chart"></div>
  </div>
 </body>
</html>

<script>
var C ="<?php echo $C ?>";
Morris.Line({
 element : 'chart',
 data:[<?php echo $chart_data; ?>],
 xkey:'date',
 ykeys:[C],
 labels:[C],
 hideHover:'auto',
 stacked:true
});
</script>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/49c37bdc-2032-469d-8357-077dd8973a28n%40googlegroups.com.

Reply via email to