Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Flot Examples</title>
- <link href="layout.css" rel="stylesheet" type="text/css">
- <!--[if lte IE 8]><![endif]-->
- <script type="text/javascript" src="./js/excanvas.min.js"></script>
- <script type="text/javascript" src="./js/jquery.js"></script>
- <script type="text/javascript" src="./js/jquery.flot.js"></script>
- </head>
- <body>
- <h1>Flot Examples</h1>
- <div id="placeholder" style="width:600px;height:300px;"></div>
- <p>Simple example. </p>
- <?php
- $server = "localhost";
- $user="harish";
- $password="password";
- $database = "db";
- $connection = mysql_connect($server,$user,$password);
- $db = mysql_select_db($database,$connection);
- query = "SELECT xval,yval FROM flottable";
- $result = mysql_query($query);
- while($row = mysql_fetch_assoc($result))
- {
- $dataset1[] = array($row['xval'],$row['yval']);
- }
- ?>
- <script type="text/javascript">
- $(function () {
- var dataset1 = <?php echo json_encode($dataset1); ?>;
- $.plot($("#placeholder"), [ dataset1 ]);
- });
- /* $(function () {
- var d1 = [];
- for (var i = 0; i < 14; i += 0.5)
- d1.push([i, Math.sin(i)]);
- $.plot($("#placeholder"), [ d1 ]); });
- */
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement