Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <?php // content="text/plain; charset=utf-8"
- require_once ('src/jpgraph.php');
- require_once ('src/jpgraph_line.php');
- require_once ('src/jpgraph_error.php');
- $dbc = pg_connect("host=localhost dbname=u2route user=postgres password=yuliana port=5432");
- if (!$dbc) {
- die("Error in connection: " . pg_last_error());
- }
- // Connect to the database
- $psql2 = "SELECT bytes, time FROM frames";
- $resultpsql2 = pg_query($dbc, $psql2);
- // echo $psql2."<br>";
- if (!$resultpsql2) {
- die("Error in SQL query: " . pg_last_error()); }
- while ($datapsql = pg_fetch_array($resultpsql2)) {
- $bytes[] = $datapsql[0];
- $time[] = floatval($datapsql[1]);
- }
- //echo $bytes[2];
- // Some (random) data
- // Size of the overall graph
- $width=500;
- $height=250;
- // Create the graph and set a scale.
- // These two calls are always required
- $graph = new Graph($width,$height);
- $graph->SetScale('int');
- // Create the linear plot
- $lplot=new LinePlot($bytes, $time);
- // Add the plot to the graph
- $graph->Add($lplot);
- ?>
- <body>
- <!-- Aqui va el codigo de los tabs -->
- <?php
- // Display the graph
- $graph->Stroke()
- ?>
- <!-- Aqui termina el codigo de los tabs -->
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement