Advertisement
Guest User

Untitled

a guest
Jan 21st, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>Flot Examples</title>
  6. <link href="layout.css" rel="stylesheet" type="text/css">
  7. <!--[if lte IE 8]><![endif]-->
  8. <script type="text/javascript" src="./js/excanvas.min.js"></script>
  9. <script type="text/javascript" src="./js/jquery.js"></script>
  10. <script type="text/javascript" src="./js/jquery.flot.js"></script>
  11. </head>
  12. <body>
  13. <h1>Flot Examples</h1>
  14.  
  15. <div id="placeholder" style="width:600px;height:300px;"></div>
  16.  
  17. <p>Simple example. </p>
  18. <?php
  19.  
  20. $server = "localhost";
  21. $user="harish";
  22. $password="password";
  23. $database = "db";
  24.  
  25. $connection = mysql_connect($server,$user,$password);
  26. $db = mysql_select_db($database,$connection);
  27.  
  28. query = "SELECT xval,yval FROM flottable";
  29. $result = mysql_query($query);
  30.  
  31. while($row = mysql_fetch_assoc($result))
  32. {
  33. $dataset1[] = array($row['xval'],$row['yval']);
  34. }
  35.  
  36. ?>
  37.  
  38. <script type="text/javascript">
  39. $(function () {
  40. var dataset1 = <?php echo json_encode($dataset1); ?>;
  41.  
  42. $.plot($("#placeholder"), [ dataset1 ]);
  43.  
  44.  
  45. });
  46. /* $(function () {
  47. var d1 = [];
  48. for (var i = 0; i < 14; i += 0.5)
  49. d1.push([i, Math.sin(i)]);
  50. $.plot($("#placeholder"), [ d1 ]); });
  51. */
  52. </script>
  53.  
  54. </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement