Folder reorganize 1
This commit is contained in:
81
OLD/OLD Trends/trends/pan9.php
Normal file
81
OLD/OLD Trends/trends/pan9.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
// content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('src/jpgraph.php');
|
||||
require_once ('src/jpgraph_line.php');
|
||||
|
||||
// FOR DB CONNECTION
|
||||
$link = mysql_connect('controls2k8', 'corey', '41945549')
|
||||
or die('Could not connect: ' . mysql_error());
|
||||
|
||||
mysql_select_db('controls') or die('Could not select database');
|
||||
|
||||
$dataArray=array();
|
||||
|
||||
//get data from database
|
||||
$sql="SELECT timestamp, pan5lvl, pan6lvl, pan7lvl, pan8lvl, pan9lvl FROM pans where pans.id mod 7 = 0 GROUP BY timestamp DESC LIMIT 96";
|
||||
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
|
||||
if ($result) {
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
$datay[] = $row["timestamp"];
|
||||
$datax1[] = $row["pan5lvl"];
|
||||
$datax2[] = $row["pan6lvl"];
|
||||
$datax3[] = $row["pan7lvl"];
|
||||
$datax4[] = $row["pan8lvl"];
|
||||
$datax5[] = $row["pan9lvl"];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$n = 5;
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
$targ1[$i] = "#$i";
|
||||
$alts1[$i] = "Level=%d";
|
||||
}
|
||||
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,110,0,96);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
$graph->xaxis->scale->ticks->Set(5);
|
||||
|
||||
$theme_class=new UniversalTheme;
|
||||
|
||||
$graph->SetTheme($theme_class);
|
||||
$graph->img->SetAntiAliasing(false);
|
||||
$graph->title->Set('Graph');
|
||||
$graph->img->SetMargin(70,15,30,125); // Sets the margin. L, R, T, B
|
||||
$graph->title->Set('Pan 9 Level');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('%');
|
||||
$graph->SetBox(false);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Pan Level');
|
||||
$graph->yaxis->SetTitleMargin(50);
|
||||
|
||||
$graph->xgrid->Show();
|
||||
$graph->xgrid->SetLineStyle("solid");
|
||||
$graph->xaxis->SetTickLabels($datay);
|
||||
$graph->xaxis->SetLabelAngle(65);
|
||||
$graph->xgrid->SetColor('#E3E3E3');
|
||||
|
||||
// Create line 5
|
||||
$p5=new LinePlot($datax5);
|
||||
$p5->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p5);
|
||||
$p5->SetColor("red");
|
||||
$p5->mark->SetType(MARK_CIRCLE);
|
||||
$p5->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/pan9.php');
|
||||
?>
|
||||
Reference in New Issue
Block a user