Folder reorganize 1
This commit is contained in:
107
OLD/OLD Trends/trends/allmills.php
Normal file
107
OLD/OLD Trends/trends/allmills.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
// content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('src/jpgraph.php');
|
||||
require_once ('src/jpgraph_line.php');
|
||||
|
||||
// FOR DB CONNECTION
|
||||
$link = mysql_connect('rachet', '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, mill1spd, MILL2SPD, MILL3SPD, MILL4SPD, MILL5SPD, MILL6SPD FROM trending where trending.id mod 16 = 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["mill1spd"];
|
||||
$datax2[] = $row["MILL2SPD"];
|
||||
$datax3[] = $row["MILL3SPD"];
|
||||
$datax4[] = $row["MILL4SPD"];
|
||||
$datax5[] = $row["MILL5SPD"];
|
||||
$datax6[] = $row["MILL6SPD"];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,5000,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,100); // Sets the margin. L, R, T, B
|
||||
$graph->title->Set('All Mill Speeds Past 24 Hours');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('RPM');
|
||||
$graph->SetBox(false);
|
||||
$graph->legend->SetPos($aX,$aY,$aHAlign='right',$aVAlign='top');
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Mill Speed');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("#6495ED");
|
||||
$p1->SetLegend('Mill 1');
|
||||
|
||||
// Create line 2
|
||||
$p2=new LinePlot($datax2);
|
||||
$graph->Add($p2);
|
||||
$p2->SetColor("#B22222");
|
||||
$p2->SetLegend('Mill 2');
|
||||
|
||||
// Create line 3
|
||||
$p3=new LinePlot($datax3);
|
||||
$graph->Add($p3);
|
||||
$p3->SetColor("orange");
|
||||
$p3->SetLegend('Mill 3');
|
||||
|
||||
// Create line 4
|
||||
$p4=new LinePlot($datax4);
|
||||
$graph->Add($p4);
|
||||
$p4->SetColor("blue");
|
||||
$p4->SetLegend('Mill 4');
|
||||
|
||||
// Create line 5
|
||||
$p5=new LinePlot($datax5);
|
||||
$graph->Add($p5);
|
||||
$p5->SetColor("red");
|
||||
$p5->SetLegend('Mill 5');
|
||||
|
||||
// Create line 5
|
||||
$p6=new LinePlot($datax6);
|
||||
$graph->Add($p6);
|
||||
$p6->SetColor("green");
|
||||
$p6->SetLegend('Mill 6');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
105
OLD/OLD Trends/trends/allpans.php
Normal file
105
OLD/OLD Trends/trends/allpans.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?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"];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('intlin',0,105);
|
||||
//$graph->SetTickDensity(TICKD_DENSE);
|
||||
//$graph->SetTickInterval(1,2);
|
||||
|
||||
$theme_class=new UniversalTheme;
|
||||
|
||||
$graph->SetTheme($theme_class);
|
||||
$graph->img->SetAntiAliasing(false);
|
||||
$graph->title->Set('Graph');
|
||||
$graph->img->SetMargin(70,15,30,100); // Sets the margin. L, R, T, B
|
||||
//$graph->SetMarginColor('silver');
|
||||
$graph->title->Set('All Pan Levels');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('%');
|
||||
$graph->SetBox(false);
|
||||
$graph->footer->right->Set('Timer (ms): ');
|
||||
$graph->footer->SetTimer($timer);
|
||||
$graph->legend->SetPos($aX,$aY,$aHAlign='right',$aVAlign='top');
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel(false);
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Pan Level');
|
||||
$graph->yaxis->SetTitleMargin(50);
|
||||
|
||||
$graph->xgrid->Show(true,true);
|
||||
$graph->xgrid->SetLineStyle("solid");
|
||||
$graph->xaxis->SetTickLabels($datay);
|
||||
//$graph->xaxis->SetTickDensity(TICKD_DENSE);
|
||||
$graph->xaxis->SetLabelAngle(65);
|
||||
$graph->xgrid->SetColor('#E2E2E2');
|
||||
|
||||
|
||||
// Create line 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("#6495ED");
|
||||
$p1->SetLegend('Pan 5');
|
||||
|
||||
// Create line 2
|
||||
$p2=new LinePlot($datax2);
|
||||
$graph->Add($p2);
|
||||
$p2->SetColor("#B22222");
|
||||
$p2->SetLegend('Pan 6');
|
||||
|
||||
// Create line 3
|
||||
$p3=new LinePlot($datax3);
|
||||
$graph->Add($p3);
|
||||
$p3->SetColor("orange");
|
||||
$p3->SetLegend('Pan 7');
|
||||
|
||||
// Create line 4
|
||||
$p4=new LinePlot($datax4);
|
||||
$graph->Add($p4);
|
||||
$p4->SetColor("blue");
|
||||
$p4->SetLegend('Pan 8');
|
||||
|
||||
// Create line 5
|
||||
$p5=new LinePlot($datax5);
|
||||
$graph->Add($p5);
|
||||
$p5->SetColor("red");
|
||||
$p5->SetLegend('Pan 9');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
66
OLD/OLD Trends/trends/bbabonoff.php
Normal file
66
OLD/OLD Trends/trends/bbabonoff.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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, bbabonoff FROM trending where trending.id mod 64 = 0 GROUP BY timestamp DESC LIMIT 100";
|
||||
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
|
||||
if ($result) {
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
$datay[] = $row["timestamp"];
|
||||
$datax1[] = $row["bbabonoff"];
|
||||
|
||||
}
|
||||
}
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,2);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
|
||||
$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('Broadbent A/B Dryer');
|
||||
$graph->subtitle->Set('(48 Hours)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('RPM');
|
||||
$graph->SetBox(false);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('1 = On / 0 = Off');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("green");
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
91
OLD/OLD Trends/trends/boiler1kpph.php
Normal file
91
OLD/OLD Trends/trends/boiler1kpph.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?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, boiler1sf, boiler1fwf FROM trending where trending.id mod 16 = 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["boiler1sf"];
|
||||
$datax2[] = $row["boiler1fwf"];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$n = 5;
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
$targ1[$i] = "#$i";
|
||||
$targ2[$i] = "#$i";
|
||||
$targ3[$i] = "#$i";
|
||||
$alts1[$i] = "Steam Flow=%d";
|
||||
$alts2[$i] = "Feed Water Flow=%d";
|
||||
$alts3[$i] = "val=%d";
|
||||
}
|
||||
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,200);
|
||||
$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('Boiler 1 Steam Flow and Feed Water Flow');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('%');
|
||||
$graph->SetBox(false);
|
||||
$graph->legend->SetPos($aX,$aY,$aHAlign='right',$aVAlign='top');
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('KPPH');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$p1->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("#B22222");
|
||||
$p1->mark->SetType(MARK_CIRCLE);
|
||||
$p1->SetLegend('Steam Flow');
|
||||
|
||||
// Create line 2
|
||||
$p2=new LinePlot($datax2);
|
||||
$p2->SetCSIMTargets($targ2,$alts2);
|
||||
$graph->Add($p2);
|
||||
$p2->SetColor("#6495ED");
|
||||
$p2->mark->SetType(MARK_CIRCLE);
|
||||
$p2->SetLegend('Feed Water Flow');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/boiler1kpph.php');
|
||||
?>
|
||||
91
OLD/OLD Trends/trends/boiler2kpph.php
Normal file
91
OLD/OLD Trends/trends/boiler2kpph.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?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, boiler2sf, boiler2fwf FROM trending where trending.id mod 16 = 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["boiler2sf"];
|
||||
$datax2[] = $row["boiler2fwf"];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$n = 5;
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
$targ1[$i] = "#$i";
|
||||
$targ2[$i] = "#$i";
|
||||
$targ3[$i] = "#$i";
|
||||
$alts1[$i] = "Steam Flow=%d";
|
||||
$alts2[$i] = "Feed Water Flow=%d";
|
||||
$alts3[$i] = "val=%d";
|
||||
}
|
||||
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,200);
|
||||
$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('Boiler 2 Steam Flow and Feed Water Flow');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('%');
|
||||
$graph->SetBox(false);
|
||||
$graph->legend->SetPos($aX,$aY,$aHAlign='right',$aVAlign='top');
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('KPPH');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$p1->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("#B22222");
|
||||
$p1->mark->SetType(MARK_CIRCLE);
|
||||
$p1->SetLegend('Steam Flow');
|
||||
|
||||
// Create line 2
|
||||
$p2=new LinePlot($datax2);
|
||||
$p2->SetCSIMTargets($targ2,$alts2);
|
||||
$graph->Add($p2);
|
||||
$p2->SetColor("#6495ED");
|
||||
$p2->mark->SetType(MARK_CIRCLE);
|
||||
$p2->SetLegend('Feed Water Flow');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/boiler2kpph.php');
|
||||
?>
|
||||
91
OLD/OLD Trends/trends/boiler3kpph.php
Normal file
91
OLD/OLD Trends/trends/boiler3kpph.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?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, boiler3sf, boiler3fwf FROM trending where trending.id mod 16 = 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["boiler3sf"];
|
||||
$datax2[] = $row["boiler3fwf"];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$n = 5;
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
$targ1[$i] = "#$i";
|
||||
$targ2[$i] = "#$i";
|
||||
$targ3[$i] = "#$i";
|
||||
$alts1[$i] = "Steam Flow=%d";
|
||||
$alts2[$i] = "Feed Water Flow=%d";
|
||||
$alts3[$i] = "val=%d";
|
||||
}
|
||||
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,200);
|
||||
$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('Boiler 3 Steam Flow and Feed Water Flow');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('%');
|
||||
$graph->SetBox(false);
|
||||
$graph->legend->SetPos($aX,$aY,$aHAlign='right',$aVAlign='top');
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('KPPH');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$p1->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("#B22222");
|
||||
$p1->mark->SetType(MARK_CIRCLE);
|
||||
$p1->SetLegend('Steam Flow');
|
||||
|
||||
// Create line 2
|
||||
$p2=new LinePlot($datax2);
|
||||
$p2->SetCSIMTargets($targ2,$alts2);
|
||||
$graph->Add($p2);
|
||||
$p2->SetColor("#6495ED");
|
||||
$p2->mark->SetType(MARK_CIRCLE);
|
||||
$p2->SetLegend('Feed Water Flow');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/boiler3kpph.php');
|
||||
?>
|
||||
91
OLD/OLD Trends/trends/boiler4kpph.php
Normal file
91
OLD/OLD Trends/trends/boiler4kpph.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?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, boiler4sf, boiler4fwf FROM trending where trending.id mod 16 = 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["boiler4sf"];
|
||||
$datax2[] = $row["boiler4fwf"];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$n = 5;
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
$targ1[$i] = "#$i";
|
||||
$targ2[$i] = "#$i";
|
||||
$targ3[$i] = "#$i";
|
||||
$alts1[$i] = "Steam Flow=%d";
|
||||
$alts2[$i] = "Feed Water Flow=%d";
|
||||
$alts3[$i] = "val=%d";
|
||||
}
|
||||
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,200);
|
||||
$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('Boiler 4 Steam Flow and Feed Water Flow');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('%');
|
||||
$graph->SetBox(false);
|
||||
$graph->legend->SetPos($aX,$aY,$aHAlign='right',$aVAlign='top');
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('KPPH');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$p1->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("#B22222");
|
||||
$p1->mark->SetType(MARK_CIRCLE);
|
||||
$p1->SetLegend('Steam Flow');
|
||||
|
||||
// Create line 2
|
||||
$p2=new LinePlot($datax2);
|
||||
$p2->SetCSIMTargets($targ2,$alts2);
|
||||
$graph->Add($p2);
|
||||
$p2->SetColor("#6495ED");
|
||||
$p2->mark->SetType(MARK_CIRCLE);
|
||||
$p2->SetLegend('Feed Water Flow');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/boiler4kpph.php');
|
||||
?>
|
||||
91
OLD/OLD Trends/trends/boiler5kpph.php
Normal file
91
OLD/OLD Trends/trends/boiler5kpph.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?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, boiler5sf, boiler5fwf FROM trending where trending.id mod 16 = 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["boiler5sf"];
|
||||
$datax2[] = $row["boiler5fwf"];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$n = 5;
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
$targ1[$i] = "#$i";
|
||||
$targ2[$i] = "#$i";
|
||||
$targ3[$i] = "#$i";
|
||||
$alts1[$i] = "Steam Flow=%d";
|
||||
$alts2[$i] = "Feed Water Flow=%d";
|
||||
$alts3[$i] = "val=%d";
|
||||
}
|
||||
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,200);
|
||||
$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('Boiler 5 Steam Flow and Feed Water Flow');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('%');
|
||||
$graph->SetBox(false);
|
||||
$graph->legend->SetPos($aX,$aY,$aHAlign='right',$aVAlign='top');
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('KPPH');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$p1->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("#B22222");
|
||||
$p1->mark->SetType(MARK_CIRCLE);
|
||||
$p1->SetLegend('Steam Flow');
|
||||
|
||||
// Create line 2
|
||||
$p2=new LinePlot($datax2);
|
||||
$p2->SetCSIMTargets($targ2,$alts2);
|
||||
$graph->Add($p2);
|
||||
$p2->SetColor("#6495ED");
|
||||
$p2->mark->SetType(MARK_CIRCLE);
|
||||
$p2->SetLegend('Feed Water Flow');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/boiler5kpph.php');
|
||||
?>
|
||||
92
OLD/OLD Trends/trends/boiler6kpph.php
Normal file
92
OLD/OLD Trends/trends/boiler6kpph.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?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, boiler6sf, boiler6fwf FROM trending where trending.id mod 16 = 0 GROUP BY timestamp DESC LIMIT 100";
|
||||
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
|
||||
if ($result) {
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
$datay[] = $row["timestamp"];
|
||||
$datax1[] = $row["boiler6sf"];
|
||||
$datax2[] = $row["boiler6fwf"];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$n = 5;
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
$targ1[$i] = "#$i";
|
||||
$targ2[$i] = "#$i";
|
||||
$targ3[$i] = "#$i";
|
||||
$alts1[$i] = "Steam Flow=%d";
|
||||
$alts2[$i] = "Feed Water Flow=%d";
|
||||
$alts3[$i] = "val=%d";
|
||||
}
|
||||
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,200);
|
||||
$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('Boiler 6 Steam Flow and Feed Water Flow');
|
||||
$graph->title->SetCSIMTarget(sprintf($fmtStr,-1),'Title for Bar');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('%');
|
||||
$graph->SetBox(false);
|
||||
$graph->legend->SetPos($aX,$aY,$aHAlign='right',$aVAlign='top');
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('KPPH');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$p1->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("#B22222");
|
||||
$p1->mark->SetType(MARK_CIRCLE);
|
||||
$p1->SetLegend('Steam Flow');
|
||||
|
||||
// Create line 2
|
||||
$p2=new LinePlot($datax2);
|
||||
$p2->mark->SetType(MARK_CIRCLE);
|
||||
$p2->SetCSIMTargets($targ2,$alts2);
|
||||
$graph->Add($p2);
|
||||
$p2->SetColor("#6495ED");
|
||||
$p2->SetLegend('Feed Water Flow');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/boiler6kpph.php');
|
||||
?>
|
||||
129
OLD/OLD Trends/trends/boilersteam.php
Normal file
129
OLD/OLD Trends/trends/boilersteam.php
Normal file
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
// content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('src/jpgraph.php');
|
||||
require_once ('src/jpgraph_line.php');
|
||||
|
||||
|
||||
// FOR DB CONNECTION
|
||||
$link = mysql_connect('192.168.0.14', '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 date, exhaustpr, ttlsteamflow, livestmpr, exststmflow1, exststmflow2 FROM trending where trending.id mod 7 = 0 GROUP BY date DESC LIMIT 96";
|
||||
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
|
||||
if ($result) {
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
$datay[] = $row["date"];
|
||||
$datax1[] = $row["exhaustpr"];
|
||||
$datax2[] = $row["ttlsteamflow"];
|
||||
$datax3[] = $row["livestmpr"];
|
||||
$datax4[] = $row["exststmflow1"];
|
||||
$datax5[] = $row["exststmflow2"];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$n = 5;
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
$targ1[$i] = "#$i";
|
||||
$targ2[$i] = "#$i";
|
||||
$targ3[$i] = "#$i";
|
||||
$targ4[$i] = "#$i";
|
||||
$targ5[$i] = "#$i";
|
||||
$alts1[$i] = "Exhaust Pressure=%d PSI";
|
||||
$alts2[$i] = "Total Steam Flow=%d KPPH";
|
||||
$alts3[$i] = "Live Steam Pressure=%d PSI";
|
||||
$alts4[$i] = "Exhaust Steam Flow 1=%d KPPH";
|
||||
$alts5[$i] = "Exhaust Steam Flow 2=%d KPPH";
|
||||
}
|
||||
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('intlin',0,800);
|
||||
$graph->SetYScale(0,'int',0,25);
|
||||
$graph->SetYScale(1,'int',0,85);
|
||||
|
||||
$theme_class=new UniversalTheme;
|
||||
|
||||
$graph->img->SetMargin(70,100,30,100); // Sets the margin. L, R, T, B
|
||||
$graph->SetMarginColor('whiite');
|
||||
$graph->title->Set('Boiler Steam Values');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set(1);
|
||||
$graph->yaxis->title->Set('%');
|
||||
$graph->SetBox(false);
|
||||
//$graph->footer->right->Set('Timer (ms): ');
|
||||
//$graph->footer->SetTimer($timer);
|
||||
//$graph->legend->SetPos($aX,$aY,$aHAlign='right',$aVAlign='top');
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set(0);
|
||||
$graph->yaxis->SetTitleMargin(50);
|
||||
|
||||
$graph->xgrid->Show(true,true);
|
||||
$graph->xgrid->SetLineStyle("solid");
|
||||
$graph->xaxis->SetTickLabels($datay);
|
||||
//$graph->xaxis->SetTickDensity(TICKD_DENSE);
|
||||
$graph->xaxis->SetLabelAngle(65);
|
||||
$graph->xgrid->SetColor('#E2E2E2');
|
||||
|
||||
|
||||
// Create line 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$p1->SetCSIMTargets($targ1,$alts1);
|
||||
$p1->mark->SetType(MARK_CIRCLE);
|
||||
$graph->AddY(0,$p1);
|
||||
$p1->SetColor("#6495ED");
|
||||
$p1->SetLegend('Exhaust Pressure - PSI');
|
||||
$graph->ynaxis[0]->SetColor('#6495ED');
|
||||
|
||||
// Create line 2
|
||||
$p2=new LinePlot($datax2);
|
||||
$p2->SetCSIMTargets($targ2,$alts2);
|
||||
$p2->mark->SetType(MARK_CIRCLE);
|
||||
$graph->Add($p2);
|
||||
$p2->SetColor("#B22222");
|
||||
$p2->SetLegend('Total Steam Flow - KPPH');
|
||||
|
||||
|
||||
// Create line 3
|
||||
$p3=new LinePlot($datax3);
|
||||
$p3->SetCSIMTargets($targ3,$alts3);
|
||||
$p3->mark->SetType(MARK_CIRCLE);
|
||||
$graph->Add($p3);
|
||||
$p3->SetColor("orange");
|
||||
$p3->SetLegend('Live Steam Pressure - PSI');
|
||||
|
||||
// Create line 4
|
||||
$p4=new LinePlot($datax4);
|
||||
$p4->SetCSIMTargets($targ4,$alts4);
|
||||
$p4->mark->SetType(MARK_CIRCLE);
|
||||
$graph->AddY(1,$p4);
|
||||
$p4->SetColor("darkgreen");
|
||||
$p4->SetLegend('Exhaust Steam Flow 1 - KPPH');
|
||||
|
||||
// Create line 5
|
||||
$p5=new LinePlot($datax5);
|
||||
$p5->SetCSIMTargets($targ5,$alts5);
|
||||
$p5->mark->SetType(MARK_CIRCLE);
|
||||
$graph->AddY(1,$p5);
|
||||
$p5->SetColor("green");
|
||||
$p5->SetLegend('Exhaust Steam Flow 2 - KPPH');
|
||||
$graph->ynaxis[1]->SetColor("green");
|
||||
$graph->ynaxis[1]->title->Set(1);
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/boilersteam.php');
|
||||
?>
|
||||
14
OLD/OLD Trends/trends/dbcon.php
Normal file
14
OLD/OLD Trends/trends/dbcon.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// The server host name or number running your MySQL database
|
||||
// usually 127.0.0.1 or localhost will suffice
|
||||
$dbhost = "controls2k8";
|
||||
//
|
||||
// The username used to log-in to your database server
|
||||
$dbuser ="corey";
|
||||
//
|
||||
// The password used to log-in to your database server
|
||||
$dbpassword ="41945549";
|
||||
//
|
||||
// The name of the MySQL database we will store the tables in
|
||||
$database ="controls";
|
||||
?>
|
||||
66
OLD/OLD Trends/trends/finalmoltemp.php
Normal file
66
OLD/OLD Trends/trends/finalmoltemp.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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, finalmoltemp FROM trending where trending.id mod 16 = 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["finalmoltemp"];
|
||||
|
||||
}
|
||||
}
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,600);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
|
||||
$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('Final Molasses Temp Past 24 Hours');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('F');
|
||||
$graph->SetBox(false);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Temperature');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("green");
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
66
OLD/OLD Trends/trends/grindrate.php
Normal file
66
OLD/OLD Trends/trends/grindrate.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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, tonshr FROM trending where trending.id mod 16 = 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["tonshr"];
|
||||
|
||||
}
|
||||
}
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,900);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
|
||||
$theme_class=new UniversalTheme;
|
||||
|
||||
$graph->SetTheme($theme_class);
|
||||
$graph->img->SetAntiAliasing(false);
|
||||
$graph->title->Set('Graph');
|
||||
$graph->img->SetMargin(70,15,30,100); // Sets the margin. L, R, T, B
|
||||
$graph->title->Set('Grinding Rate Past 24 Hours');
|
||||
$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('Grinding Rate');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("#6495ED");
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
66
OLD/OLD Trends/trends/immibition.php
Normal file
66
OLD/OLD Trends/trends/immibition.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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, imbflow FROM trending where trending.id mod 16 = 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["imbflow"];
|
||||
|
||||
}
|
||||
}
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,600);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
|
||||
$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('Immibition Flow Past 24 Hours');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('GPM');
|
||||
$graph->SetBox(false);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Immibition Flow');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("green");
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
91
OLD/OLD Trends/trends/lbsperhr24.php
Normal file
91
OLD/OLD Trends/trends/lbsperhr24.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?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, prevtons, lbsperhr FROM trending where trending.id mod 2880 = 0 GROUP BY timestamp DESC LIMIT 100";
|
||||
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
|
||||
if ($result) {
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
$datay[] = $row["timestamp"];
|
||||
$datax1[] = $row["prevtons"];
|
||||
$datax2[] = $row["lbsperhr"];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$n = 5;
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
$targ1[$i] = "#$i";
|
||||
$targ2[$i] = "#$i";
|
||||
$targ3[$i] = "#$i";
|
||||
$alts1[$i] = "Previous Day Ground=%d";
|
||||
$alts2[$i] = "LBS Steam Per Hour=%d";
|
||||
$alts3[$i] = "val=%d";
|
||||
}
|
||||
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,14000);
|
||||
$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('Previous Day Ground and LBS Steam Per Hour');
|
||||
$graph->subtitle->Set('(Every 24 Hours)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('%');
|
||||
$graph->SetBox(false);
|
||||
$graph->legend->SetPos($aX,$aY,$aHAlign='right',$aVAlign='top');
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$p1->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("#B22222");
|
||||
$p1->mark->SetType(MARK_CIRCLE);
|
||||
$p1->SetLegend('Previous Day Ground');
|
||||
|
||||
// Create line 2
|
||||
$p2=new LinePlot($datax2);
|
||||
$p2->SetCSIMTargets($targ2,$alts2);
|
||||
$graph->Add($p2);
|
||||
$p2->SetColor("#6495ED");
|
||||
$p2->mark->SetType(MARK_CIRCLE);
|
||||
$p2->SetLegend('LBS Steam Per Hour');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/lbsperhr24.php');
|
||||
?>
|
||||
66
OLD/OLD Trends/trends/mill1spd.php
Normal file
66
OLD/OLD Trends/trends/mill1spd.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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, mill1spd FROM trending where trending.id mod 16 = 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["mill1spd"];
|
||||
|
||||
}
|
||||
}
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,5000);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
|
||||
$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('Mill 1 Speed Past 24 Hours');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('RPM');
|
||||
$graph->SetBox(false);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Mill Speed');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("green");
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
67
OLD/OLD Trends/trends/mill1spd2.php
Normal file
67
OLD/OLD Trends/trends/mill1spd2.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?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, mill1spd FROM trending where trending.id mod 1 = 0 GROUP BY timestamp DESC LIMIT 100";
|
||||
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
|
||||
if ($result) {
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
$datay[] = $row["timestamp"];
|
||||
$datax1[] = $row["mill1spd"];
|
||||
|
||||
}
|
||||
}
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,5000);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
|
||||
$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('Mill 1 Speed Past 24 Hours');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('RPM');
|
||||
$graph->SetBox(false);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Mill Speed');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("green");
|
||||
$p1->mark->SetType(MARK_CIRCLE);
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
66
OLD/OLD Trends/trends/mill2spd.php
Normal file
66
OLD/OLD Trends/trends/mill2spd.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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, mill2spd FROM trending where trending.id mod 16 = 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["mill2spd"];
|
||||
|
||||
}
|
||||
}
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,5000);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
|
||||
$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('Mill 2 Speed Past 24 Hours');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('RPM');
|
||||
$graph->SetBox(false);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Mill Speed');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("orange");
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
66
OLD/OLD Trends/trends/mill3spd.php
Normal file
66
OLD/OLD Trends/trends/mill3spd.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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, mill3spd FROM trending where trending.id mod 16 = 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["mill3spd"];
|
||||
|
||||
}
|
||||
}
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,5000);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
|
||||
$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('Mill 3 Speed Past 24 Hours');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('RPM');
|
||||
$graph->SetBox(false);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Mill Speed');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("green");
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
66
OLD/OLD Trends/trends/mill4spd.php
Normal file
66
OLD/OLD Trends/trends/mill4spd.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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, mill4spd FROM trending where trending.id mod 16 = 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["mill4spd"];
|
||||
|
||||
}
|
||||
}
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,5000);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
|
||||
$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('Mill 4 Speed Past 24 Hours');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('RPM');
|
||||
$graph->SetBox(false);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Mill Speed');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("orange");
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
66
OLD/OLD Trends/trends/mill5spd.php
Normal file
66
OLD/OLD Trends/trends/mill5spd.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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, mill5spd FROM trending where trending.id mod 16 = 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["mill5spd"];
|
||||
|
||||
}
|
||||
}
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,5000);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
|
||||
$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('Mill 5 Speed Past 24 Hours');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('RPM');
|
||||
$graph->SetBox(false);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Mill Speed');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("blue");
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
66
OLD/OLD Trends/trends/mill6spd.php
Normal file
66
OLD/OLD Trends/trends/mill6spd.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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, mill6spd FROM trending where trending.id mod 16 = 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["mill6spd"];
|
||||
|
||||
}
|
||||
}
|
||||
// Setup the graph
|
||||
$graph = new Graph(1600,520);
|
||||
$graph->SetScale('linlin',0,5000);
|
||||
$graph->yaxis->scale->ticks->Set(5,10);
|
||||
|
||||
$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('Mill 6 Speed Past 24 Hours');
|
||||
$graph->subtitle->Set('(15 Minute Intervals)');
|
||||
$graph->xaxis->title->Set();
|
||||
$graph->yaxis->title->Set('RPM');
|
||||
$graph->SetBox(false);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
|
||||
$graph->yaxis->HideZeroLabel();
|
||||
$graph->yaxis->HideLine(false);
|
||||
$graph->yaxis->HideTicks(false,false);
|
||||
$graph->yaxis->title->Set('Mill Speed');
|
||||
$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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("red");
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
?>
|
||||
81
OLD/OLD Trends/trends/pan5.php
Normal file
81
OLD/OLD Trends/trends/pan5.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 5 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 1
|
||||
$p1=new LinePlot($datax1);
|
||||
$p1->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p1);
|
||||
$p1->SetColor("#6495ED");
|
||||
$p1->mark->SetType(MARK_CIRCLE);
|
||||
$p1->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/pan5.php');
|
||||
?>
|
||||
81
OLD/OLD Trends/trends/pan6.php
Normal file
81
OLD/OLD Trends/trends/pan6.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 6 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 2
|
||||
$p2=new LinePlot($datax2);
|
||||
$p2->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p2);
|
||||
$p2->SetColor("#B22222");
|
||||
$p2->mark->SetType(MARK_CIRCLE);
|
||||
$p2->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/pan6.php');
|
||||
?>
|
||||
81
OLD/OLD Trends/trends/pan7.php
Normal file
81
OLD/OLD Trends/trends/pan7.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 7 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 3
|
||||
$p3=new LinePlot($datax3);
|
||||
$p3->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p3);
|
||||
$p3->SetColor("orange");
|
||||
$p3->mark->SetType(MARK_CIRCLE);
|
||||
$p3->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/pan7.php');
|
||||
?>
|
||||
81
OLD/OLD Trends/trends/pan8.php
Normal file
81
OLD/OLD Trends/trends/pan8.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 8 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 4
|
||||
$p4=new LinePlot($datax4);
|
||||
$p4->SetCSIMTargets($targ1,$alts1);
|
||||
$graph->Add($p4);
|
||||
$p4->SetColor("blue");
|
||||
$p4->mark->SetType(MARK_CIRCLE);
|
||||
$p4->SetLegend('');
|
||||
|
||||
$graph->legend->SetFrameWeight(1);
|
||||
|
||||
// Output line
|
||||
$graph->StrokeCSIM('../trends/pan8.php');
|
||||
?>
|
||||
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');
|
||||
?>
|
||||
40
OLD/OLD Trends/trends/src/Examples/accbarex1.php
Normal file
40
OLD/OLD Trends/trends/src/Examples/accbarex1.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
$data1y=array(-8,8,9,3,5,6);
|
||||
$data2y=array(18,2,1,7,5,4);
|
||||
|
||||
// Create the graph. These two calls are always required
|
||||
$graph = new Graph(500,400);
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
$graph->SetShadow();
|
||||
$graph->img->SetMargin(40,30,20,40);
|
||||
|
||||
// Create the bar plots
|
||||
$b1plot = new BarPlot($data1y);
|
||||
$b1plot->SetFillColor("orange");
|
||||
$b1plot->value->Show();
|
||||
$b2plot = new BarPlot($data2y);
|
||||
$b2plot->SetFillColor("blue");
|
||||
$b2plot->value->Show();
|
||||
|
||||
// Create the grouped bar plot
|
||||
$gbplot = new AccBarPlot(array($b1plot,$b2plot));
|
||||
|
||||
// ...and add it to the graPH
|
||||
$graph->Add($gbplot);
|
||||
|
||||
$graph->title->Set("Accumulated bar plots");
|
||||
$graph->xaxis->title->Set("X-title");
|
||||
$graph->yaxis->title->Set("Y-title");
|
||||
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Display the graph
|
||||
$graph->Stroke();
|
||||
?>
|
||||
31
OLD/OLD Trends/trends/src/Examples/accbarframeex01.php
Normal file
31
OLD/OLD Trends/trends/src/Examples/accbarframeex01.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
$datay1=array(13,8,19,7,17,6);
|
||||
$datay2=array(4,5,2,7,5,25);
|
||||
|
||||
// Create the graph.
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale('textlin');
|
||||
$graph->SetMarginColor('white');
|
||||
|
||||
// Setup title
|
||||
$graph->title->Set('Acc bar with gradient');
|
||||
|
||||
// Create the first bar
|
||||
$bplot = new BarPlot($datay1);
|
||||
$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT);
|
||||
$bplot->SetColor('darkred');
|
||||
|
||||
// Create the second bar
|
||||
$bplot2 = new BarPlot($datay2);
|
||||
$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT);
|
||||
$bplot2->SetColor('darkgreen');
|
||||
|
||||
// And join them in an accumulated bar
|
||||
$accbplot = new AccBarPlot(array($bplot,$bplot2));
|
||||
$graph->Add($accbplot);
|
||||
|
||||
$graph->Stroke();
|
||||
?>
|
||||
33
OLD/OLD Trends/trends/src/Examples/accbarframeex02.php
Normal file
33
OLD/OLD Trends/trends/src/Examples/accbarframeex02.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
$datay1=array(13,8,19,7,17,6);
|
||||
$datay2=array(4,5,2,7,5,25);
|
||||
|
||||
// Create the graph.
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale('textlin');
|
||||
$graph->SetMarginColor('white');
|
||||
|
||||
// Setup title
|
||||
$graph->title->Set('Acc bar with gradient');
|
||||
|
||||
// Create the first bar
|
||||
$bplot = new BarPlot($datay1);
|
||||
$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT);
|
||||
$bplot->SetColor('darkred');
|
||||
|
||||
// Create the second bar
|
||||
$bplot2 = new BarPlot($datay2);
|
||||
$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT);
|
||||
$bplot2->SetColor('darkgreen');
|
||||
|
||||
// And join them in an accumulated bar
|
||||
$accbplot = new AccBarPlot(array($bplot,$bplot2));
|
||||
$accbplot->SetColor('red');
|
||||
$accbplot->SetWeight(1);
|
||||
$graph->Add($accbplot);
|
||||
|
||||
$graph->Stroke();
|
||||
?>
|
||||
35
OLD/OLD Trends/trends/src/Examples/accbarframeex03.php
Normal file
35
OLD/OLD Trends/trends/src/Examples/accbarframeex03.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
$datay1=array(13,8,19,7,17,6);
|
||||
$datay2=array(4,5,2,7,5,25);
|
||||
|
||||
// Create the graph.
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale('textlin');
|
||||
$graph->SetMarginColor('white');
|
||||
|
||||
// Setup title
|
||||
$graph->title->Set('Acc bar with gradient');
|
||||
|
||||
// Create the first bar
|
||||
$bplot = new BarPlot($datay1);
|
||||
$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT);
|
||||
$bplot->SetColor('darkred');
|
||||
$bplot->SetWeight(0);
|
||||
|
||||
// Create the second bar
|
||||
$bplot2 = new BarPlot($datay2);
|
||||
$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT);
|
||||
$bplot2->SetColor('darkgreen');
|
||||
$bplot2->SetWeight(0);
|
||||
|
||||
// And join them in an accumulated bar
|
||||
$accbplot = new AccBarPlot(array($bplot,$bplot2));
|
||||
$accbplot->SetColor('darkgray');
|
||||
$accbplot->SetWeight(1);
|
||||
$graph->Add($accbplot);
|
||||
|
||||
$graph->Stroke();
|
||||
?>
|
||||
75
OLD/OLD Trends/trends/src/Examples/alphabarex1.php
Normal file
75
OLD/OLD Trends/trends/src/Examples/alphabarex1.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// Some data
|
||||
$datay1=array(140,110,50,60);
|
||||
$datay2=array(35,90,190,190);
|
||||
$datay3=array(20,60,70,140);
|
||||
|
||||
// Create the basic graph
|
||||
$graph = new Graph(450,250,'auto');
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(40,80,30,40);
|
||||
|
||||
// Adjust the position of the legend box
|
||||
$graph->legend->Pos(0.02,0.15);
|
||||
|
||||
// Adjust the color for theshadow of the legend
|
||||
$graph->legend->SetShadow('darkgray@0.5');
|
||||
$graph->legend->SetFillColor('lightblue@0.3');
|
||||
|
||||
// Get localised version of the month names
|
||||
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
|
||||
|
||||
// Set a nice summer (in Stockholm) image
|
||||
$graph->SetBackgroundImage('stship.jpg',BGIMG_COPY);
|
||||
|
||||
// Set axis titles and fonts
|
||||
$graph->xaxis->title->Set('Year 2002');
|
||||
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->xaxis->title->SetColor('white');
|
||||
|
||||
$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->xaxis->SetColor('white');
|
||||
|
||||
$graph->yaxis->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->yaxis->SetColor('white');
|
||||
|
||||
//$graph->ygrid->Show(false);
|
||||
$graph->ygrid->SetColor('white@0.5');
|
||||
|
||||
// Setup graph title
|
||||
$graph->title->Set('Using alpha blending with a background');
|
||||
// Some extra margin (from the top)
|
||||
$graph->title->SetMargin(3);
|
||||
$graph->title->SetFont(FF_ARIAL,FS_NORMAL,12);
|
||||
|
||||
// Create the three var series we will combine
|
||||
$bplot1 = new BarPlot($datay1);
|
||||
$bplot2 = new BarPlot($datay2);
|
||||
$bplot3 = new BarPlot($datay3);
|
||||
|
||||
// Setup the colors with 40% transparency (alpha channel)
|
||||
$bplot1->SetFillColor('orange@0.4');
|
||||
$bplot2->SetFillColor('brown@0.4');
|
||||
$bplot3->SetFillColor('darkgreen@0.4');
|
||||
|
||||
// Setup legends
|
||||
$bplot1->SetLegend('Label 1');
|
||||
$bplot2->SetLegend('Label 2');
|
||||
$bplot3->SetLegend('Label 3');
|
||||
|
||||
// Setup each bar with a shadow of 50% transparency
|
||||
$bplot1->SetShadow('black@0.4');
|
||||
$bplot2->SetShadow('black@0.4');
|
||||
$bplot3->SetShadow('black@0.4');
|
||||
|
||||
$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3));
|
||||
$gbarplot->SetWidth(0.6);
|
||||
$graph->Add($gbarplot);
|
||||
|
||||
$graph->Stroke();
|
||||
?>
|
||||
|
||||
18
OLD/OLD Trends/trends/src/Examples/antispamex01.php
Normal file
18
OLD/OLD Trends/trends/src/Examples/antispamex01.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Antispam example using a random string
|
||||
require_once "jpgraph/jpgraph_antispam.php";
|
||||
|
||||
// Create new anti-spam challenge creator
|
||||
// Note: Neither '0' (digit) or 'O' (letter) can be used to avoid confusion
|
||||
$spam = new AntiSpam();
|
||||
|
||||
// Create a random 5 char challenge and return the string generated
|
||||
$chars = $spam->Rand(5);
|
||||
|
||||
// Stroke random cahllenge
|
||||
if( $spam->Stroke() === false ) {
|
||||
die('Illegal or no data to plot');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
58
OLD/OLD Trends/trends/src/Examples/aqua_example.php
Normal file
58
OLD/OLD Trends/trends/src/Examples/aqua_example.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
$theme = isset($_GET['theme']) ? $_GET['theme'] : null;
|
||||
|
||||
$data = array (
|
||||
0 => array (0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32, ),
|
||||
1 => array (0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94, ),
|
||||
2 => array (0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7, ),
|
||||
3 => array ( 0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38, ),
|
||||
4 => array ( 0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7, ),
|
||||
5 => array ( 0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57, ),
|
||||
6 => array ( 0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51, ),
|
||||
7 => array ( 0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47, ),
|
||||
8 => array ( 0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34, ),
|
||||
);
|
||||
|
||||
|
||||
// Create the graph. These two calls are always required
|
||||
$graph = new Graph(400,300);
|
||||
|
||||
$graph->SetScale("textlin");
|
||||
if ($theme) {
|
||||
$graph->SetTheme(new $theme());
|
||||
}
|
||||
$theme_class = new AquaTheme;
|
||||
$graph->SetTheme($theme_class);
|
||||
|
||||
$plot = array();
|
||||
// Create the bar plots
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
$plot[$i] = new BarPlot($data[$i]);
|
||||
$plot[$i]->SetLegend('plot'.($i+1));
|
||||
}
|
||||
//$acc1 = new AccBarPlot(array($plot[0], $plot[1]));
|
||||
//$acc1->value->Show();
|
||||
$gbplot = new GroupBarPlot(array($plot[2], $plot[1] ));
|
||||
|
||||
for ($i = 4; $i < 8; $i++) {
|
||||
$plot[$i] = new LinePlot($data[$i]);
|
||||
$plot[$i]->SetLegend('plot'.$i);
|
||||
$plot[$i]->value->Show();
|
||||
}
|
||||
|
||||
$graph->Add($gbplot);
|
||||
$graph->Add($plot[4]);
|
||||
|
||||
$title = "AquaTheme Example";
|
||||
$title = mb_convert_encoding($title,'UTF-8');
|
||||
$graph->title->Set($title);
|
||||
$graph->xaxis->title->Set("X-title");
|
||||
$graph->yaxis->title->Set("Y-title");
|
||||
|
||||
// Display the graph
|
||||
$graph->Stroke();
|
||||
?>
|
||||
35
OLD/OLD Trends/trends/src/Examples/axislabelbkgex01.php
Normal file
35
OLD/OLD Trends/trends/src/Examples/axislabelbkgex01.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
$ydata = array(12,19,3,9,15,10);
|
||||
|
||||
// The code to setup a very basic graph
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale('intlin');
|
||||
$graph->SetMargin(30,15,40,30);
|
||||
$graph->SetMarginColor('white');
|
||||
$graph->SetFrame(true,'blue',3);
|
||||
|
||||
$graph->title->Set('Label background');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
$graph->subtitle->Set('"LABELBKG_NONE"');
|
||||
|
||||
$graph->SetAxisLabelBackground(LABELBKG_NONE,'orange','red','lightblue','red');
|
||||
|
||||
// Use Ariel font
|
||||
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->xgrid->Show();
|
||||
|
||||
// Create the plot line
|
||||
$p1 = new LinePlot($ydata);
|
||||
$graph->Add($p1);
|
||||
|
||||
// Output graph
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex02.php
Normal file
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex02.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
$ydata = array(12,19,3,9,15,10);
|
||||
|
||||
// The code to setup a very basic graph
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale('intlin');
|
||||
$graph->SetMargin(30,15,40,30);
|
||||
$graph->SetMarginColor('white');
|
||||
$graph->SetFrame(true,'blue',3);
|
||||
|
||||
$graph->title->Set('Label background');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
$graph->subtitle->Set('"LABELBKG_XAXIS"');
|
||||
|
||||
$graph->SetAxisLabelBackground(LABELBKG_XAXIS,'orange','red','lightblue','red');
|
||||
|
||||
// Use Ariel font
|
||||
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->xgrid->Show();
|
||||
|
||||
// Create the plot line
|
||||
$p1 = new LinePlot($ydata);
|
||||
$graph->Add($p1);
|
||||
|
||||
// Output graph
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex03.php
Normal file
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex03.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
$ydata = array(12,19,3,9,15,10);
|
||||
|
||||
// The code to setup a very basic graph
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale('intlin');
|
||||
$graph->SetMargin(30,15,40,30);
|
||||
$graph->SetMarginColor('white');
|
||||
$graph->SetFrame(true,'blue',3);
|
||||
|
||||
$graph->title->Set('Label background');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
$graph->subtitle->Set('"LABELBKG_YAXIS"');
|
||||
|
||||
$graph->SetAxisLabelBackground(LABELBKG_YAXIS,'orange','red','lightblue','red');
|
||||
|
||||
// Use Ariel font
|
||||
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->xgrid->Show();
|
||||
|
||||
// Create the plot line
|
||||
$p1 = new LinePlot($ydata);
|
||||
$graph->Add($p1);
|
||||
|
||||
// Output graph
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex04.php
Normal file
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex04.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
$ydata = array(12,19,3,9,15,10);
|
||||
|
||||
// The code to setup a very basic graph
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale('intlin');
|
||||
$graph->SetMargin(30,15,40,30);
|
||||
$graph->SetMarginColor('white');
|
||||
$graph->SetFrame(true,'blue',3);
|
||||
|
||||
$graph->title->Set('Label background');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
$graph->subtitle->Set('"LABELBKG_YAXISFULL"');
|
||||
|
||||
$graph->SetAxisLabelBackground(LABELBKG_YAXISFULL,'orange','red','lightblue','red');
|
||||
|
||||
// Use Ariel font
|
||||
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->xgrid->Show();
|
||||
|
||||
// Create the plot line
|
||||
$p1 = new LinePlot($ydata);
|
||||
$graph->Add($p1);
|
||||
|
||||
// Output graph
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex05.php
Normal file
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex05.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
$ydata = array(12,19,3,9,15,10);
|
||||
|
||||
// The code to setup a very basic graph
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale('intlin');
|
||||
$graph->SetMargin(30,15,40,30);
|
||||
$graph->SetMarginColor('white');
|
||||
$graph->SetFrame(true,'blue',3);
|
||||
|
||||
$graph->title->Set('Label background');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
$graph->subtitle->Set('"LABELBKG_XAXISFULL"');
|
||||
|
||||
$graph->SetAxisLabelBackground(LABELBKG_XAXISFULL,'orange','red','lightblue','red');
|
||||
|
||||
// Use Ariel font
|
||||
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->xgrid->Show();
|
||||
|
||||
// Create the plot line
|
||||
$p1 = new LinePlot($ydata);
|
||||
$graph->Add($p1);
|
||||
|
||||
// Output graph
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex06.php
Normal file
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex06.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
$ydata = array(12,19,3,9,15,10);
|
||||
|
||||
// The code to setup a very basic graph
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale('intlin');
|
||||
$graph->SetMargin(30,15,40,30);
|
||||
$graph->SetMarginColor('white');
|
||||
$graph->SetFrame(true,'blue',3);
|
||||
|
||||
$graph->title->Set('Label background');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
$graph->subtitle->Set('"LABELBKG_XYFULL"');
|
||||
|
||||
$graph->SetAxisLabelBackground(LABELBKG_XYFULL,'orange','red','lightblue','red');
|
||||
|
||||
// Use Ariel font
|
||||
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->xgrid->Show();
|
||||
|
||||
// Create the plot line
|
||||
$p1 = new LinePlot($ydata);
|
||||
$graph->Add($p1);
|
||||
|
||||
// Output graph
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex07.php
Normal file
37
OLD/OLD Trends/trends/src/Examples/axislabelbkgex07.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
$ydata = array(12,19,3,9,15,10);
|
||||
|
||||
// The code to setup a very basic graph
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale('intlin');
|
||||
$graph->SetMargin(30,15,40,30);
|
||||
$graph->SetMarginColor('white');
|
||||
$graph->SetFrame(true,'blue',3);
|
||||
|
||||
$graph->title->Set('Label background');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
$graph->subtitle->SetFont(FF_ARIAL,FS_NORMAL,10);
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
$graph->subtitle->Set('"LABELBKG_XY"');
|
||||
|
||||
$graph->SetAxisLabelBackground(LABELBKG_XY,'orange','red','lightblue','red');
|
||||
|
||||
// Use Ariel font
|
||||
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->yaxis->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$graph->xgrid->Show();
|
||||
|
||||
// Create the plot line
|
||||
$p1 = new LinePlot($ydata);
|
||||
$graph->Add($p1);
|
||||
|
||||
// Output graph
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
38
OLD/OLD Trends/trends/src/Examples/background_type_ex0.php
Normal file
38
OLD/OLD Trends/trends/src/Examples/background_type_ex0.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
// Some data
|
||||
$ydata = array(11,3,8,12,5,1,9,13,5,7);
|
||||
|
||||
// Create the graph. These two calls are always required
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMargin(40,40,50,50);
|
||||
|
||||
// Setup the grid and plotarea box
|
||||
$graph->ygrid->SetLineStyle('dashed');
|
||||
$graph->ygrid->setColor('darkgray');
|
||||
$graph->SetBox(true);
|
||||
|
||||
// Steup graph titles
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
$graph->title->Set('Using background image');
|
||||
$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11);
|
||||
$graph->subtitle->Set('"BGIMG_COPY"');
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
|
||||
// Add background with 25% mix
|
||||
$graph->SetBackgroundImage('heat1.jpg',BGIMG_COPY);
|
||||
$graph->SetBackgroundImageMix(25);
|
||||
|
||||
// Create the linear plot
|
||||
$lineplot=new LinePlot($ydata);
|
||||
$lineplot->SetColor("blue");
|
||||
|
||||
// Add the plot to the graph
|
||||
$graph->Add($lineplot);
|
||||
|
||||
// Display the graph
|
||||
$graph->Stroke();
|
||||
?>
|
||||
38
OLD/OLD Trends/trends/src/Examples/background_type_ex1.php
Normal file
38
OLD/OLD Trends/trends/src/Examples/background_type_ex1.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
// Some data
|
||||
$ydata = array(11,3,8,12,5,1,9,13,5,7);
|
||||
|
||||
// Create the graph. These two calls are always required
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMargin(40,40,50,50);
|
||||
|
||||
// Setup the grid and plotarea box
|
||||
$graph->ygrid->SetLineStyle('dashed');
|
||||
$graph->ygrid->setColor('darkgray');
|
||||
$graph->SetBox(true);
|
||||
|
||||
// Steup graph titles
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
$graph->title->Set('Using background image');
|
||||
$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11);
|
||||
$graph->subtitle->Set('"BGIMG_CENTER"');
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
|
||||
// Add background with 25% mix
|
||||
$graph->SetBackgroundImage('heat1.jpg',BGIMG_CENTER);
|
||||
$graph->SetBackgroundImageMix(25);
|
||||
|
||||
// Create the linear plot
|
||||
$lineplot=new LinePlot($ydata);
|
||||
$lineplot->SetColor("blue");
|
||||
|
||||
// Add the plot to the graph
|
||||
$graph->Add($lineplot);
|
||||
|
||||
// Display the graph
|
||||
$graph->Stroke();
|
||||
?>
|
||||
38
OLD/OLD Trends/trends/src/Examples/background_type_ex2.php
Normal file
38
OLD/OLD Trends/trends/src/Examples/background_type_ex2.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
// Some data
|
||||
$ydata = array(11,3,8,12,5,1,9,13,5,7);
|
||||
|
||||
// Create the graph. These two calls are always required
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMargin(40,40,50,50);
|
||||
|
||||
// Setup the grid and plotarea box
|
||||
$graph->ygrid->SetLineStyle('dashed');
|
||||
$graph->ygrid->setColor('darkgray');
|
||||
$graph->SetBox(true);
|
||||
|
||||
// Steup graph titles
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
$graph->title->Set('Using background image');
|
||||
$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11);
|
||||
$graph->subtitle->Set('"BGIMG_FREE"');
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
|
||||
// Add background with 25% mix
|
||||
$graph->SetBackgroundImage('heat1.jpg',BGIMG_FREE);
|
||||
$graph->SetBackgroundImageMix(25);
|
||||
|
||||
// Create the linear plot
|
||||
$lineplot=new LinePlot($ydata);
|
||||
$lineplot->SetColor("blue");
|
||||
|
||||
// Add the plot to the graph
|
||||
$graph->Add($lineplot);
|
||||
|
||||
// Display the graph
|
||||
$graph->Stroke();
|
||||
?>
|
||||
38
OLD/OLD Trends/trends/src/Examples/background_type_ex3.php
Normal file
38
OLD/OLD Trends/trends/src/Examples/background_type_ex3.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
// Some data
|
||||
$ydata = array(11,3,8,12,5,1,9,13,5,7);
|
||||
|
||||
// Create the graph. These two calls are always required
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMargin(40,40,50,50);
|
||||
|
||||
// Setup the grid and plotarea box
|
||||
$graph->ygrid->SetLineStyle('dashed');
|
||||
$graph->ygrid->setColor('darkgray');
|
||||
$graph->SetBox(true);
|
||||
|
||||
// Steup graph titles
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
$graph->title->Set('Using background image');
|
||||
$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11);
|
||||
$graph->subtitle->Set('"BGIMG_FILLPLOT"');
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
|
||||
// Add background with 25% mix
|
||||
$graph->SetBackgroundImage('heat1.jpg',BGIMG_FILLPLOT);
|
||||
$graph->SetBackgroundImageMix(25);
|
||||
|
||||
// Create the linear plot
|
||||
$lineplot=new LinePlot($ydata);
|
||||
$lineplot->SetColor("blue");
|
||||
|
||||
// Add the plot to the graph
|
||||
$graph->Add($lineplot);
|
||||
|
||||
// Display the graph
|
||||
$graph->Stroke();
|
||||
?>
|
||||
38
OLD/OLD Trends/trends/src/Examples/background_type_ex4.php
Normal file
38
OLD/OLD Trends/trends/src/Examples/background_type_ex4.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
// Some data
|
||||
$ydata = array(11,3,8,12,5,1,9,13,5,7);
|
||||
|
||||
// Create the graph. These two calls are always required
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMargin(40,40,50,50);
|
||||
|
||||
// Setup the grid and plotarea box
|
||||
$graph->ygrid->SetLineStyle('dashed');
|
||||
$graph->ygrid->setColor('darkgray');
|
||||
$graph->SetBox(true);
|
||||
|
||||
// Steup graph titles
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
$graph->title->Set('Using background image');
|
||||
$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11);
|
||||
$graph->subtitle->Set('"BGIMG_FILLFRAME"');
|
||||
$graph->subtitle->SetColor('darkred');
|
||||
|
||||
// Add background with 25% mix
|
||||
$graph->SetBackgroundImage('heat1.jpg',BGIMG_FILLFRAME);
|
||||
$graph->SetBackgroundImageMix(25);
|
||||
|
||||
// Create the linear plot
|
||||
$lineplot=new LinePlot($ydata);
|
||||
$lineplot->SetColor("blue");
|
||||
|
||||
// Add the plot to the graph
|
||||
$graph->Add($lineplot);
|
||||
|
||||
// Display the graph
|
||||
$graph->Stroke();
|
||||
?>
|
||||
51
OLD/OLD Trends/trends/src/Examples/backgroundex01.php
Normal file
51
OLD/OLD Trends/trends/src/Examples/backgroundex01.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
// Some data
|
||||
$datay = array(28,19,18,23,12,11);
|
||||
$data2y = array(14,18,33,29,39,55);
|
||||
|
||||
// A nice graph with anti-aliasing
|
||||
$graph = new Graph(400,200);
|
||||
$graph->img->SetMargin(40,180,40,40);
|
||||
$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLPLOT);
|
||||
|
||||
$graph->img->SetAntiAliasing("white");
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetShadow();
|
||||
$graph->title->Set("Background image");
|
||||
|
||||
// Use built in font
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Slightly adjust the legend from it's default position in the
|
||||
// top right corner.
|
||||
$graph->legend->Pos(0.05,0.5,"right","center");
|
||||
|
||||
// Create the first line
|
||||
$p1 = new LinePlot($datay);
|
||||
$p1->mark->SetType(MARK_FILLEDCIRCLE);
|
||||
$p1->mark->SetFillColor("red");
|
||||
$p1->mark->SetWidth(4);
|
||||
$p1->SetColor("blue");
|
||||
$p1->SetCenter();
|
||||
$p1->SetLegend("Triumph Tiger -98");
|
||||
$graph->Add($p1);
|
||||
|
||||
// ... and the second
|
||||
$p2 = new LinePlot($data2y);
|
||||
$p2->mark->SetType(MARK_STAR);
|
||||
$p2->mark->SetFillColor("red");
|
||||
$p2->mark->SetWidth(4);
|
||||
$p2->SetColor("red");
|
||||
$p2->SetCenter();
|
||||
$p2->SetLegend("New tiger -99");
|
||||
$graph->Add($p2);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
51
OLD/OLD Trends/trends/src/Examples/backgroundex02.php
Normal file
51
OLD/OLD Trends/trends/src/Examples/backgroundex02.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
// Some data
|
||||
$datay = array(28,19,18,23,12,11);
|
||||
$data2y = array(14,18,33,29,39,55);
|
||||
|
||||
// A nice graph with anti-aliasing
|
||||
$graph = new Graph(400,200);
|
||||
$graph->img->SetMargin(40,180,40,40);
|
||||
$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);
|
||||
|
||||
$graph->img->SetAntiAliasing();
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetShadow();
|
||||
$graph->title->Set("Background image");
|
||||
|
||||
// Use built in font
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Slightly adjust the legend from it's default position in the
|
||||
// top right corner.
|
||||
$graph->legend->Pos(0.05,0.5,"right","center");
|
||||
|
||||
// Create the first line
|
||||
$p1 = new LinePlot($datay);
|
||||
$p1->mark->SetType(MARK_FILLEDCIRCLE);
|
||||
$p1->mark->SetFillColor("red");
|
||||
$p1->mark->SetWidth(4);
|
||||
$p1->SetColor("blue");
|
||||
$p1->SetCenter();
|
||||
$p1->SetLegend("Triumph Tiger -98");
|
||||
$graph->Add($p1);
|
||||
|
||||
// ... and the second
|
||||
$p2 = new LinePlot($data2y);
|
||||
$p2->mark->SetType(MARK_STAR);
|
||||
$p2->mark->SetFillColor("red");
|
||||
$p2->mark->SetWidth(4);
|
||||
$p2->SetColor("red");
|
||||
$p2->SetCenter();
|
||||
$p2->SetLegend("New tiger -99");
|
||||
$graph->Add($p2);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
51
OLD/OLD Trends/trends/src/Examples/backgroundex03.php
Normal file
51
OLD/OLD Trends/trends/src/Examples/backgroundex03.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
// Some data
|
||||
$datay = array(28,19,18,23,12,11);
|
||||
$data2y = array(14,18,33,29,39,55);
|
||||
|
||||
// A nice graph with anti-aliasing
|
||||
$graph = new Graph(400,200);
|
||||
$graph->img->SetMargin(40,180,40,40);
|
||||
$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_COPY);
|
||||
|
||||
$graph->img->SetAntiAliasing("white");
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetShadow();
|
||||
$graph->title->Set("Background image");
|
||||
|
||||
// Use built in font
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Slightly adjust the legend from it's default position in the
|
||||
// top right corner.
|
||||
$graph->legend->Pos(0.05,0.5,"right","center");
|
||||
|
||||
// Create the first line
|
||||
$p1 = new LinePlot($datay);
|
||||
$p1->mark->SetType(MARK_FILLEDCIRCLE);
|
||||
$p1->mark->SetFillColor("red");
|
||||
$p1->mark->SetWidth(4);
|
||||
$p1->SetColor("blue");
|
||||
$p1->SetCenter();
|
||||
$p1->SetLegend("Triumph Tiger -98");
|
||||
$graph->Add($p1);
|
||||
|
||||
// ... and the second
|
||||
$p2 = new LinePlot($data2y);
|
||||
$p2->mark->SetType(MARK_STAR);
|
||||
$p2->mark->SetFillColor("red");
|
||||
$p2->mark->SetWidth(4);
|
||||
$p2->SetColor("red");
|
||||
$p2->SetCenter();
|
||||
$p2->SetLegend("New tiger -99");
|
||||
$graph->Add($p2);
|
||||
|
||||
// Output line
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
56
OLD/OLD Trends/trends/src/Examples/balloonex1.php
Normal file
56
OLD/OLD Trends/trends/src/Examples/balloonex1.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// $Id: balloonex1.php,v 1.5 2002/12/15 16:08:51 aditus Exp $
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_scatter.php');
|
||||
|
||||
// Some data
|
||||
$datax = array(1,2,3,4,5,6,7,8);
|
||||
$datay = array(12,23,95,18,65,28,86,44);
|
||||
// Callback for markers
|
||||
// Must return array(width,color,fill_color)
|
||||
// If any of the returned values are "" then the
|
||||
// default value for that parameter will be used.
|
||||
function FCallback($aVal) {
|
||||
// This callback will adjust the fill color and size of
|
||||
// the datapoint according to the data value according to
|
||||
if( $aVal < 30 ) $c = "blue";
|
||||
elseif( $aVal < 70 ) $c = "green";
|
||||
else $c="red";
|
||||
return array(floor($aVal/3),"",$c);
|
||||
}
|
||||
|
||||
// Setup a basic graph
|
||||
$graph = new Graph(400,300,'auto');
|
||||
$graph->SetScale("linlin");
|
||||
$graph->img->SetMargin(40,100,40,40);
|
||||
$graph->SetShadow();
|
||||
$graph->title->Set("Example of ballon scatter plot");
|
||||
// Use a lot of grace to get large scales
|
||||
$graph->yaxis->scale->SetGrace(50,10);
|
||||
|
||||
// Make sure X-axis as at the bottom of the graph
|
||||
$graph->xaxis->SetPos('min');
|
||||
|
||||
// Create the scatter plot
|
||||
$sp1 = new ScatterPlot($datay,$datax);
|
||||
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
|
||||
|
||||
// Uncomment the following two lines to display the values
|
||||
$sp1->value->Show();
|
||||
$sp1->value->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Specify the callback
|
||||
$sp1->mark->SetCallback("FCallback");
|
||||
|
||||
// Setup the legend for plot
|
||||
$sp1->SetLegend('Year 2002');
|
||||
|
||||
// Add the scatter plot to the graph
|
||||
$graph->Add($sp1);
|
||||
|
||||
// ... and send to browser
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
81
OLD/OLD Trends/trends/src/Examples/balloonex2.php
Normal file
81
OLD/OLD Trends/trends/src/Examples/balloonex2.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_scatter.php');
|
||||
|
||||
// Each ballon is specificed by four values.
|
||||
// (X,Y,Size,Color)
|
||||
$data = array(
|
||||
array(1,12,10,'orange'),
|
||||
array(3,41,15,'red'),
|
||||
array(4,5,19,'lightblue'),
|
||||
array(5,70,22,'yellow')
|
||||
);
|
||||
|
||||
|
||||
|
||||
// We need to create X,Y data vectors suitable for the
|
||||
// library from the above raw data.
|
||||
$n = count($data);
|
||||
for( $i=0; $i < $n; ++$i ) {
|
||||
|
||||
$datax[$i] = $data[$i][0];
|
||||
$datay[$i] = $data[$i][1];
|
||||
|
||||
// Create a faster lookup array so we don't have to search
|
||||
// for the correct values in the callback function
|
||||
$format[strval($datax[$i])][strval($datay[$i])] = array($data[$i][2],$data[$i][3]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Callback for markers
|
||||
// Must return array(width,border_color,fill_color,filename,imgscale)
|
||||
// If any of the returned values are '' then the
|
||||
// default value for that parameter will be used (possible empty)
|
||||
function FCallback($aYVal,$aXVal) {
|
||||
global $format;
|
||||
return array($format[strval($aXVal)][strval($aYVal)][0],'',
|
||||
$format[strval($aXVal)][strval($aYVal)][1],'','');
|
||||
}
|
||||
|
||||
// Setup a basic graph
|
||||
$graph = new Graph(450,300,'auto');
|
||||
$graph->SetScale("intlin");
|
||||
$graph->SetMargin(40,40,40,40);
|
||||
$graph->SetMarginColor('wheat');
|
||||
|
||||
$graph->title->Set("Example of ballon scatter plot with X,Y callback");
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
$graph->title->SetMargin(10);
|
||||
|
||||
// Use a lot of grace to get large scales since the ballon have
|
||||
// size and we don't want them to collide with the X-axis
|
||||
$graph->yaxis->scale->SetGrace(50,10);
|
||||
$graph->xaxis->scale->SetGrace(50,10);
|
||||
|
||||
// Make sure X-axis as at the bottom of the graph and not at the default Y=0
|
||||
$graph->xaxis->SetPos('min');
|
||||
|
||||
// Set X-scale to start at 0
|
||||
$graph->xscale->SetAutoMin(0);
|
||||
|
||||
// Create the scatter plot
|
||||
$sp1 = new ScatterPlot($datay,$datax);
|
||||
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
|
||||
|
||||
// Uncomment the following two lines to display the values
|
||||
$sp1->value->Show();
|
||||
$sp1->value->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Specify the callback
|
||||
$sp1->mark->SetCallbackYX("FCallback");
|
||||
|
||||
// Add the scatter plot to the graph
|
||||
$graph->Add($sp1);
|
||||
|
||||
// ... and send to browser
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
48
OLD/OLD Trends/trends/src/Examples/bar2scalesex1.php
Normal file
48
OLD/OLD Trends/trends/src/Examples/bar2scalesex1.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
$datay=array(20,30,50,80);
|
||||
$datay2=array(430,645,223,690);
|
||||
$datazero=array(0,0,0,0);
|
||||
|
||||
// Create the graph.
|
||||
$graph = new Graph(450,200);
|
||||
$graph->title->Set('Example with 2 scale bars');
|
||||
|
||||
// Setup Y and Y2 scales with some "grace"
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetY2Scale("lin");
|
||||
$graph->yaxis->scale->SetGrace(30);
|
||||
$graph->y2axis->scale->SetGrace(30);
|
||||
|
||||
//$graph->ygrid->Show(true,true);
|
||||
$graph->ygrid->SetColor('gray','lightgray@0.5');
|
||||
|
||||
// Setup graph colors
|
||||
$graph->SetMarginColor('white');
|
||||
$graph->y2axis->SetColor('darkred');
|
||||
|
||||
|
||||
// Create the "dummy" 0 bplot
|
||||
$bplotzero = new BarPlot($datazero);
|
||||
|
||||
// Create the "Y" axis group
|
||||
$ybplot1 = new BarPlot($datay);
|
||||
$ybplot1->value->Show();
|
||||
$ybplot = new GroupBarPlot(array($ybplot1,$bplotzero));
|
||||
|
||||
// Create the "Y2" axis group
|
||||
$ybplot2 = new BarPlot($datay2);
|
||||
$ybplot2->value->Show();
|
||||
$ybplot2->value->SetColor('darkred');
|
||||
$ybplot2->SetFillColor('darkred');
|
||||
$y2bplot = new GroupBarPlot(array($bplotzero,$ybplot2));
|
||||
|
||||
// Add the grouped bar plots to the graph
|
||||
$graph->Add($ybplot);
|
||||
$graph->AddY2($y2bplot);
|
||||
|
||||
// .. and finally stroke the image back to browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
52
OLD/OLD Trends/trends/src/Examples/bar_csimex1.php
Normal file
52
OLD/OLD Trends/trends/src/Examples/bar_csimex1.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
$datay=array(12,26,9,17,31);
|
||||
|
||||
// Create the graph.
|
||||
// One minute timeout for the cached image
|
||||
// INLINE_NO means don't stream it back to the browser.
|
||||
$graph = new Graph(310,250,'auto');
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(60,30,20,40);
|
||||
$graph->yaxis->SetTitleMargin(45);
|
||||
$graph->yaxis->scale->SetGrace(30);
|
||||
$graph->SetShadow();
|
||||
|
||||
// Turn the tickmarks
|
||||
$graph->xaxis->SetTickSide(SIDE_DOWN);
|
||||
$graph->yaxis->SetTickSide(SIDE_LEFT);
|
||||
|
||||
// Create a bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
|
||||
// Create targets for the image maps. One for each column
|
||||
$targ=array("bar_clsmex1.php#1","bar_clsmex1.php#2","bar_clsmex1.php#3","bar_clsmex1.php#4","bar_clsmex1.php#5","bar_clsmex1.php#6");
|
||||
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
|
||||
$bplot->SetCSIMTargets($targ,$alts);
|
||||
$bplot->SetFillColor("orange");
|
||||
|
||||
// Use a shadow on the bar graphs (just use the default settings)
|
||||
$bplot->SetShadow();
|
||||
$bplot->value->SetFormat(" $ %2.1f",70);
|
||||
$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$bplot->value->SetColor("blue");
|
||||
$bplot->value->Show();
|
||||
|
||||
$graph->Add($bplot);
|
||||
|
||||
$graph->title->Set("Image maps barex1");
|
||||
$graph->xaxis->title->Set("X-title");
|
||||
$graph->yaxis->title->Set("Y-title");
|
||||
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Send back the HTML page which will call this script again
|
||||
// to retrieve the image.
|
||||
$graph->StrokeCSIM();
|
||||
|
||||
|
||||
?>
|
||||
51
OLD/OLD Trends/trends/src/Examples/bar_csimex2.php
Normal file
51
OLD/OLD Trends/trends/src/Examples/bar_csimex2.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
$data1y=array(12,8,19,3,10,5);
|
||||
$data2y=array(8,2,12,7,14,4);
|
||||
|
||||
// Create the graph. These two calls are always required
|
||||
$graph = new Graph(310,200,'auto');
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(40,30,20,40);
|
||||
$graph->SetShadow();
|
||||
|
||||
// Create the bar plots
|
||||
$b1plot = new BarPlot($data1y);
|
||||
$b1plot->SetFillColor("orange");
|
||||
$targ=array("bar_clsmex2.php#1","bar_clsmex2.php#2","bar_clsmex2.php#3",
|
||||
"bar_clsmex2.php#4","bar_clsmex2.php#5","bar_clsmex2.php#6");
|
||||
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
|
||||
$b1plot->SetCSIMTargets($targ,$alts);
|
||||
|
||||
$b2plot = new BarPlot($data2y);
|
||||
$b2plot->SetFillColor("blue");
|
||||
$targ=array("bar_clsmex2.php#7","bar_clsmex2.php#8","bar_clsmex2.php#9",
|
||||
"bar_clsmex2.php#10","bar_clsmex2.php#11","bar_clsmex2.php#12");
|
||||
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
|
||||
$b2plot->SetCSIMTargets($targ,$alts);
|
||||
|
||||
// Create the grouped bar plot
|
||||
$abplot = new AccBarPlot(array($b1plot,$b2plot));
|
||||
|
||||
$abplot->SetShadow();
|
||||
$abplot->value->Show();
|
||||
|
||||
// ...and add it to the graPH
|
||||
$graph->Add($abplot);
|
||||
|
||||
$graph->title->Set("Image map barex2");
|
||||
$graph->xaxis->title->Set("X-title");
|
||||
$graph->yaxis->title->Set("Y-title");
|
||||
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
|
||||
// Send back the HTML page which will call this script again
|
||||
// to retrieve the image.
|
||||
$graph->StrokeCSIM();
|
||||
|
||||
?>
|
||||
88
OLD/OLD Trends/trends/src/Examples/bar_csimex3.php
Normal file
88
OLD/OLD Trends/trends/src/Examples/bar_csimex3.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// $Id: bar_csimex3.php,v 1.3 2002/08/31 20:03:46 aditus Exp $
|
||||
// Horiontal bar graph with image maps
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
$data1y=array(5,8,19,3,10,5);
|
||||
$data2y=array(12,2,12,7,14,4);
|
||||
|
||||
// Setup the basic parameters for the graph
|
||||
$graph = new Graph(400,700);
|
||||
$graph->SetAngle(90);
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
// The negative margins are necessary since we
|
||||
// have rotated the image 90 degress and shifted the
|
||||
// meaning of width, and height. This means that the
|
||||
// left and right margins now becomes top and bottom
|
||||
// calculated with the image width and not the height.
|
||||
$graph->img->SetMargin(-80,-80,210,210);
|
||||
|
||||
$graph->SetMarginColor('white');
|
||||
|
||||
// Setup title for graph
|
||||
$graph->title->Set('Horizontal bar graph');
|
||||
$graph->title->SetFont(FF_FONT2,FS_BOLD);
|
||||
$graph->subtitle->Set("With image map\nNote: The URL just points back to this image");
|
||||
|
||||
// Setup X-axis.
|
||||
$graph->xaxis->SetTitle("X-title",'center');
|
||||
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->xaxis->title->SetAngle(90);
|
||||
$graph->xaxis->SetTitleMargin(30);
|
||||
$graph->xaxis->SetLabelMargin(15);
|
||||
$graph->xaxis->SetLabelAlign('right','center');
|
||||
|
||||
// Setup Y-axis
|
||||
|
||||
// First we want it at the bottom, i.e. the 'max' value of the
|
||||
// x-axis
|
||||
$graph->yaxis->SetPos('max');
|
||||
|
||||
// Arrange the title
|
||||
$graph->yaxis->SetTitle("Turnaround (mkr)",'center');
|
||||
$graph->yaxis->SetTitleSide(SIDE_RIGHT);
|
||||
$graph->yaxis->title->SetFont(FF_FONT2,FS_BOLD);
|
||||
$graph->yaxis->title->SetAngle(0);
|
||||
$graph->yaxis->title->Align('center','top');
|
||||
$graph->yaxis->SetTitleMargin(30);
|
||||
|
||||
// Arrange the labels
|
||||
$graph->yaxis->SetLabelSide(SIDE_RIGHT);
|
||||
$graph->yaxis->SetLabelAlign('center','top');
|
||||
|
||||
// Create the bar plots with image maps
|
||||
$b1plot = new BarPlot($data1y);
|
||||
$b1plot->SetFillColor("orange");
|
||||
$targ=array("bar_clsmex2.php#1","bar_clsmex2.php#2","bar_clsmex2.php#3",
|
||||
"bar_clsmex2.php#4","bar_clsmex2.php#5","bar_clsmex2.php#6");
|
||||
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
|
||||
$b1plot->SetCSIMTargets($targ,$alts);
|
||||
|
||||
$b2plot = new BarPlot($data2y);
|
||||
$b2plot->SetFillColor("blue");
|
||||
$targ=array("bar_clsmex2.php#7","bar_clsmex2.php#8","bar_clsmex2.php#9",
|
||||
"bar_clsmex2.php#10","bar_clsmex2.php#11","bar_clsmex2.php#12");
|
||||
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
|
||||
$b2plot->SetCSIMTargets($targ,$alts);
|
||||
|
||||
// Create the accumulated bar plot
|
||||
$abplot = new AccBarPlot(array($b1plot,$b2plot));
|
||||
$abplot->SetShadow();
|
||||
|
||||
// We want to display the value of each bar at the top
|
||||
$abplot->value->Show();
|
||||
$abplot->value->SetFont(FF_FONT1,FS_NORMAL);
|
||||
$abplot->value->SetAlign('left','center');
|
||||
$abplot->value->SetColor("black","darkred");
|
||||
$abplot->value->SetFormat('%.1f mkr');
|
||||
|
||||
// ...and add it to the graph
|
||||
$graph->Add($abplot);
|
||||
|
||||
// Send back the HTML page which will call this script again
|
||||
// to retrieve the image.
|
||||
$graph->StrokeCSIM();
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
// ==============================================
|
||||
// Output Image using Code 39 using only default values
|
||||
// ==============================================
|
||||
require_once ('jpgraph/jpgraph_barcode.php');
|
||||
|
||||
try {
|
||||
$encoder = BarcodeFactory::Create(ENCODING_CODE39);
|
||||
$e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
|
||||
$e->Stroke('abc123');
|
||||
} catch( JpGraphException $e ) {
|
||||
//echo 'Error: ' . $e->getMessage()."\n";
|
||||
JpGraphError::Raise($e->getMessage());
|
||||
}
|
||||
|
||||
?>
|
||||
11
OLD/OLD Trends/trends/src/Examples/barcode_ex0.php
Normal file
11
OLD/OLD Trends/trends/src/Examples/barcode_ex0.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
// ==============================================
|
||||
// Output Image using Code 39 using only default values
|
||||
// ==============================================
|
||||
require_once ('jpgraph/jpgraph_barcode.php');
|
||||
|
||||
$encoder = BarcodeFactory::Create(ENCODING_CODE39);
|
||||
$e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
|
||||
$e->Stroke('ABC123');
|
||||
|
||||
?>
|
||||
14
OLD/OLD Trends/trends/src/Examples/barcode_ex1.php
Normal file
14
OLD/OLD Trends/trends/src/Examples/barcode_ex1.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// ==============================================
|
||||
// Output Image using Code 128
|
||||
// ==============================================
|
||||
require_once ('jpgraph/jpgraph_barcode.php');
|
||||
|
||||
$encoder = BarcodeFactory::Create(ENCODING_CODE128);
|
||||
$e = BackendFactory::Create(BACKEND_PS,$encoder);
|
||||
$e->SetModuleWidth(2);
|
||||
$e->SetHeight(20);
|
||||
echo nl2br($e->Stroke('3125134772'));
|
||||
|
||||
|
||||
?>
|
||||
14
OLD/OLD Trends/trends/src/Examples/barcode_ex2.php
Normal file
14
OLD/OLD Trends/trends/src/Examples/barcode_ex2.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// ==============================================
|
||||
// Output Postscript of nterleaved 2 of 5
|
||||
// ==============================================
|
||||
require_once ('jpgraph/jpgraph_barcode.php');
|
||||
|
||||
$encoder = BarcodeFactory::Create(ENCODING_CODEI25);
|
||||
$e = BackendFactory::Create(BACKEND_PS,$encoder);
|
||||
$e->SetModuleWidth(2);
|
||||
$e->SetHeight(70);
|
||||
$ps = $e->Stroke('3125134772');
|
||||
echo nl2br(htmlspecialchars($ps));
|
||||
|
||||
?>
|
||||
17
OLD/OLD Trends/trends/src/Examples/barcode_ex3.php
Normal file
17
OLD/OLD Trends/trends/src/Examples/barcode_ex3.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// ==============================================
|
||||
// Output Encapsulated Postscript of interleaved 2 of 5
|
||||
// ==============================================
|
||||
require_once ('jpgraph/jpgraph_barcode.php');
|
||||
|
||||
echo "Start ...<br>";
|
||||
$encoder = BarcodeFactory::Create(ENCODING_CODEI25);
|
||||
$e = BackendFactory::Create(BACKEND_PS,$encoder);
|
||||
$e->SetModuleWidth(2);
|
||||
$e->SetHeight(70);
|
||||
$e->SetEPS();
|
||||
$ps = $e->Stroke('3125134772');
|
||||
echo nl2br(htmlspecialchars($ps));
|
||||
|
||||
|
||||
?>
|
||||
12
OLD/OLD Trends/trends/src/Examples/barcode_ex4.php
Normal file
12
OLD/OLD Trends/trends/src/Examples/barcode_ex4.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
// ==============================================
|
||||
// Output Image using Code Interleaved 2 of 5
|
||||
// ==============================================
|
||||
require_once ('jpgraph/jpgraph_barcode.php');
|
||||
|
||||
$encoder = BarcodeFactory::Create(ENCODING_CODEI25);
|
||||
$e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
|
||||
$e->SetModuleWidth(2);
|
||||
$e->Stroke('1234');
|
||||
|
||||
?>
|
||||
74
OLD/OLD Trends/trends/src/Examples/barcode_usps_example.php
Normal file
74
OLD/OLD Trends/trends/src/Examples/barcode_usps_example.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
// =======================================================
|
||||
// Example of how to format US Postal shipping information
|
||||
// =======================================================
|
||||
require_once ('jpgraph/jpgraph_barcode.php');
|
||||
|
||||
// The Full barcode standard is described in
|
||||
// http://www.usps.com/cpim/ftp/pubs/pub91/91c4.html#508hdr1
|
||||
//
|
||||
// The data start with AI=420 which means
|
||||
// "Ship to/Deliver To Postal Code (within single authority)
|
||||
//
|
||||
class USPS_Confirmation {
|
||||
function USPS_Confirmation() {
|
||||
}
|
||||
|
||||
// Private utility function
|
||||
function _USPS_chkd($aData) {
|
||||
$n = strlen($aData);
|
||||
|
||||
// Add all even numbers starting from position 1 from the end
|
||||
$et = 0 ;
|
||||
for( $i=1; $i <= $n; $i+=2 ) {
|
||||
$d = intval(substr($aData,-$i,1));
|
||||
$et += $d;
|
||||
}
|
||||
|
||||
// Add all odd numbers starting from position 2 from the end
|
||||
$ot = 0 ;
|
||||
for( $i=2; $i <= $n; $i+=2 ) {
|
||||
$d = intval(substr($aData,-$i,1));
|
||||
$ot += $d;
|
||||
}
|
||||
$tot = 3*$et + $ot;
|
||||
$chkdigit = (10 - ($tot % 10))%10;;
|
||||
return $chkdigit;
|
||||
}
|
||||
|
||||
// Get type 1 of confirmation code (with ZIP)
|
||||
function GetPICwithZIP($aZIP,$aServiceType,$aDUNS,$aSeqNbr) {
|
||||
// Convert to USPS format with AI=420 and extension starting with AI=91
|
||||
$data = '420'. $aZIP . '91' . $aServiceType . $aDUNS . $aSeqNbr;
|
||||
// Only calculate the checkdigit from the AI=91 and forward
|
||||
// and do not include the ~1 (FUNC1) in the calculation
|
||||
$cd = $this->_USPS_chkd(substr($data,8));
|
||||
$data = '420'. $aZIP . '~191' . $aServiceType . $aDUNS . $aSeqNbr;
|
||||
return $data . $cd;
|
||||
}
|
||||
|
||||
// Get type 2 of confirmation code (without ZIP)
|
||||
function GetPIC($aServiceType,$aDUNS,$aSeqNbr) {
|
||||
// Convert to USPS format with AI=91
|
||||
$data = '91' . $aServiceType . $aDUNS . $aSeqNbr;
|
||||
$cd = $this->_USPS_chkd($data);
|
||||
return $data . $cd;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$usps = new USPS_Confirmation();
|
||||
$zip = '92663';
|
||||
$service = '21';
|
||||
$DUNS = '805213907';
|
||||
$seqnr = '04508735';
|
||||
$data = $usps->GetPICwithZIP($zip,$service,$DUNS,$seqnr);
|
||||
//$data = $usps->GetPIC('01','123456789','00000001');
|
||||
|
||||
$encoder = BarcodeFactory::Create(ENCODING_EAN128);
|
||||
$e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
|
||||
$e->SetModuleWidth(2);
|
||||
$e->SetFont(FF_ARIAL,FS_NORMAL,14);
|
||||
$e->Stroke($data);
|
||||
|
||||
?>
|
||||
10
OLD/OLD Trends/trends/src/Examples/barcsim_details.php
Normal file
10
OLD/OLD Trends/trends/src/Examples/barcsim_details.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
if( empty($_GET['id']) ) {
|
||||
echo 'Incorrect argument(s) to script <b>'.basename(__FILE__).'</b>.';
|
||||
}
|
||||
else {
|
||||
echo 'Some details on bar with id='.$_GET['id'];
|
||||
}
|
||||
|
||||
?>
|
||||
41
OLD/OLD Trends/trends/src/Examples/barcsim_popup.php
Normal file
41
OLD/OLD Trends/trends/src/Examples/barcsim_popup.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// Some random data to plot
|
||||
$datay=array(12,26,9,17,31);
|
||||
|
||||
// Create the graph.
|
||||
$graph = new Graph(400,250);
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
// Create a bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
|
||||
// Create targets for the image maps so that the details are opened in a separate window
|
||||
$fmtStr = "javascript:window.open('barcsim_details.php?id=%d','_new','width=500,height=300');void(0)";
|
||||
$n = count($datay);
|
||||
$targ=array();
|
||||
$alts=array();
|
||||
for($i=0; $i < $n; ++$i) {
|
||||
$targ[$i] = sprintf($fmtStr,$i+1);
|
||||
$alts[$i] = 'val=%d';
|
||||
// Note: The format placeholder val=%d will be replaced by the actual value in the ouput HTML by the
|
||||
// library so that when the user hoovers the mouse over the bar the actual numerical value of the bar
|
||||
// will be dísplayed
|
||||
}
|
||||
$bplot->SetCSIMTargets($targ,$alts);
|
||||
|
||||
// Add plot to graph
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Setup the title, also wih a CSIM area
|
||||
$graph->title->Set("CSIM with popup windows");
|
||||
$graph->title->SetFont(FF_FONT2,FS_BOLD);
|
||||
// Assume we can give more details on the graph
|
||||
$graph->title->SetCSIMTarget(sprintf($fmtStr,-1),'Title for Bar');
|
||||
|
||||
// Send back the HTML page which will call this script again to retrieve the image.
|
||||
$graph->StrokeCSIM();
|
||||
|
||||
?>
|
||||
30
OLD/OLD Trends/trends/src/Examples/barformatcallbackex1.php
Normal file
30
OLD/OLD Trends/trends/src/Examples/barformatcallbackex1.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
$data = array(0.1235,0.4567,0.67,0.45,0.832);
|
||||
|
||||
// Callback function
|
||||
// Get called with the actual value and should return the
|
||||
// value to be displayed as a string
|
||||
function cbFmtPercentage($aVal) {
|
||||
return sprintf("%.1f%%",100*$aVal); // Convert to string
|
||||
}
|
||||
|
||||
// Create the graph.
|
||||
$graph = new Graph(400,300);
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
// Create a bar plots
|
||||
$bar1 = new BarPlot($data);
|
||||
|
||||
// Setup the callback function
|
||||
$bar1->value->SetFormatCallback("cbFmtPercentage");
|
||||
$bar1->value->Show();
|
||||
|
||||
// Add the plot to the graph
|
||||
$graph->Add($bar1);
|
||||
|
||||
// .. and send the graph back to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
47
OLD/OLD Trends/trends/src/Examples/bargradex1.php
Normal file
47
OLD/OLD Trends/trends/src/Examples/bargradex1.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Example for use of JpGraph,
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(0.13,0.25,0.21,0.35,0.31,0.06);
|
||||
$datax=array("January","February","March","April","May","June");
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(400,240);
|
||||
$graph->img->SetMargin(60,20,35,75);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMarginColor("lightblue:1.1");
|
||||
$graph->SetShadow();
|
||||
|
||||
// Set up the title for the graph
|
||||
$graph->title->Set("Bar gradient with left reflection");
|
||||
$graph->title->SetMargin(8);
|
||||
$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
|
||||
$graph->title->SetColor("darkred");
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
|
||||
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
|
||||
|
||||
// Show 0 label on Y-axis (default is not to show)
|
||||
$graph->yscale->ticks->SupressZeroLabel(false);
|
||||
|
||||
// Setup X-axis labels
|
||||
$graph->xaxis->SetTickLabels($datax);
|
||||
$graph->xaxis->SetLabelAngle(50);
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient("navy:0.9","navy:1.85",GRAD_LEFT_REFLECTION);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("white");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
48
OLD/OLD Trends/trends/src/Examples/bargradex2.php
Normal file
48
OLD/OLD Trends/trends/src/Examples/bargradex2.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Example for use of JpGraph,
|
||||
// ljp, 01/03/01 20:32
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(-0.13,0.25,-0.21,0.35,0.31,0.04);
|
||||
$datax=array("Jan","Feb","Mar","Apr","May","June");
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(400,200);
|
||||
$graph->img->SetMargin(60,20,30,50);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMarginColor("silver");
|
||||
$graph->SetShadow();
|
||||
|
||||
// Set up the title for the graph
|
||||
$graph->title->Set("Example negative bars");
|
||||
$graph->title->SetFont(FF_VERDANA,FS_NORMAL,18);
|
||||
$graph->title->SetColor("darkred");
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,12);
|
||||
$graph->xaxis->SetColor("black","red");
|
||||
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,11);
|
||||
|
||||
// Show 0 label on Y-axis (default is not to show)
|
||||
$graph->yscale->ticks->SupressZeroLabel(false);
|
||||
|
||||
// Setup X-axis labels
|
||||
$graph->xaxis->SetTickLabels($datax);
|
||||
$graph->xaxis->SetLabelAngle(50);
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient("navy","steelblue",GRAD_MIDVER);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("navy");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
50
OLD/OLD Trends/trends/src/Examples/bargradex3.php
Normal file
50
OLD/OLD Trends/trends/src/Examples/bargradex3.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Example for use of JpGraph,
|
||||
// ljp, 01/03/01 20:32
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(-0.13,0.25,-0.21,0.35,0.31,0.04);
|
||||
$datax=array("Jan","Feb","Mar","Apr","May","June");
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(400,200);
|
||||
$graph->img->SetMargin(60,20,30,50);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMarginColor("silver");
|
||||
$graph->SetShadow();
|
||||
|
||||
// Set up the title for the graph
|
||||
$graph->title->Set("Example negative bars");
|
||||
$graph->title->SetFont(FF_VERDANA,FS_NORMAL,16);
|
||||
$graph->title->SetColor("darkred");
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
|
||||
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
|
||||
|
||||
// Show 0 label on Y-axis (default is not to show)
|
||||
$graph->yscale->ticks->SupressZeroLabel(false);
|
||||
|
||||
// Setup X-axis labels
|
||||
$graph->xaxis->SetTickLabels($datax);
|
||||
$graph->xaxis->SetLabelAngle(50);
|
||||
|
||||
// Set X-axis at the minimum value of Y-axis (default will be at 0)
|
||||
$graph->xaxis->SetPos("min"); // "min" will position the x-axis at the minimum value of the Y-axis
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient("navy","steelblue",GRAD_MIDVER);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("navy");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
47
OLD/OLD Trends/trends/src/Examples/bargradex4.php
Normal file
47
OLD/OLD Trends/trends/src/Examples/bargradex4.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Example for use of JpGraph,
|
||||
// ljp, 01/03/01 19:44
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(0.3031,0.3044,0.3049,0.3040,0.3024,0.3047);
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(400,200);
|
||||
$graph->img->SetMargin(60,30,30,40);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMarginColor("teal");
|
||||
$graph->SetShadow();
|
||||
|
||||
// Set up the title for the graph
|
||||
$graph->title->Set("Bargraph with small variations");
|
||||
$graph->title->SetColor("white");
|
||||
$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
|
||||
|
||||
// Setup color for axis and labels
|
||||
$graph->xaxis->SetColor("black","white");
|
||||
$graph->yaxis->SetColor("black","white");
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
|
||||
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
|
||||
|
||||
// Setup X-axis title (color & font)
|
||||
$graph->xaxis->title->Set("X-axis");
|
||||
$graph->xaxis->title->SetColor("white");
|
||||
$graph->xaxis->title->SetFont(FF_VERDANA,FS_BOLD,10);
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$tcol=array(100,100,255);
|
||||
$fcol=array(255,100,100);
|
||||
$bplot->SetFillGradient($fcol,$tcol,GRAD_HOR);
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
52
OLD/OLD Trends/trends/src/Examples/bargradex5.php
Normal file
52
OLD/OLD Trends/trends/src/Examples/bargradex5.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Example for use of JpGraph,
|
||||
// ljp, 01/03/01 19:44
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(0.3031,0.3044,0.3049,0.3040,0.3024,0.3047);
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(400,200);
|
||||
$graph->img->SetMargin(60,30,30,40);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMarginColor("teal");
|
||||
$graph->SetShadow();
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// This is how you make the bar graph start from something other than 0
|
||||
$bplot->SetYMin(0.302);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$tcol=array(100,100,255);
|
||||
$fcol=array(255,100,100);
|
||||
$bplot->SetFillGradient($fcol,$tcol,GRAD_HOR);
|
||||
$bplot->SetFillColor("orange");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Set up the title for the graph
|
||||
$graph->title->Set("Bargraph which doesn't start from y=0");
|
||||
$graph->title->SetColor("yellow");
|
||||
$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
|
||||
|
||||
// Setup color for axis and labels
|
||||
$graph->xaxis->SetColor("black","white");
|
||||
$graph->yaxis->SetColor("black","white");
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
|
||||
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
|
||||
|
||||
// Setup X-axis title (color & font)
|
||||
$graph->xaxis->title->Set("X-axis");
|
||||
$graph->xaxis->title->SetColor("white");
|
||||
$graph->xaxis->title->SetFont(FF_VERDANA,FS_BOLD,10);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
51
OLD/OLD Trends/trends/src/Examples/bargradex6.php
Normal file
51
OLD/OLD Trends/trends/src/Examples/bargradex6.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Example for use of JpGraph,
|
||||
// ljp, 01/03/01 20:32
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(-0.13,0.25,-0.21,0.35,0.31,0.04);
|
||||
$datax=array("Jan","Feb","Mar","Apr","May","June");
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(500,200);
|
||||
$graph->img->SetMargin(60,150,30,50);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMarginColor("silver");
|
||||
$graph->SetShadow();
|
||||
|
||||
// Set up the title for the graph
|
||||
$graph->title->Set("Example negative bars");
|
||||
$graph->title->SetFont(FF_VERDANA,FS_NORMAL,16);
|
||||
$graph->title->SetColor("darkred");
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
|
||||
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
|
||||
|
||||
// Show 0 label on Y-axis (default is not to show)
|
||||
$graph->yscale->ticks->SupressZeroLabel(false);
|
||||
|
||||
// Setup X-axis labels
|
||||
$graph->xaxis->SetTickLabels($datax);
|
||||
$graph->xaxis->SetLabelAngle(50);
|
||||
|
||||
// Set X-axis at the minimum value of Y-axis (default will be at 0)
|
||||
$graph->xaxis->SetPos("min"); // "min" will position the x-axis at the minimum value of the Y-axis
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
$bplot->SetLegend("Result 1999","blue");
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient("navy","steelblue",GRAD_MIDVER);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("navy");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex1.php
Normal file
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex1.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(4,8,6);
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(25,15,25,25);
|
||||
|
||||
$graph->title->Set('"GRAD_MIDVER"');
|
||||
$graph->title->SetColor('darkred');
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_FONT1);
|
||||
$graph->yaxis->SetFont(FF_FONT1);
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_MIDVER);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("navy");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex2.php
Normal file
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex2.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(4,8,6);
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(25,15,25,25);
|
||||
|
||||
$graph->title->Set('"GRAD_MIDHOR"');
|
||||
$graph->title->SetColor('darkred');
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_FONT1);
|
||||
$graph->yaxis->SetFont(FF_FONT1);
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_MIDHOR);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("navy");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex3.php
Normal file
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex3.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(4,8,6);
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(25,15,25,25);
|
||||
|
||||
$graph->title->Set('"GRAD_HOR"');
|
||||
$graph->title->SetColor('darkred');
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_FONT1);
|
||||
$graph->yaxis->SetFont(FF_FONT1);
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_HOR);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("navy");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex4.php
Normal file
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex4.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(4,8,6);
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(25,15,25,25);
|
||||
|
||||
$graph->title->Set('"GRAD_VER"');
|
||||
$graph->title->SetColor('darkred');
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_FONT1);
|
||||
$graph->yaxis->SetFont(FF_FONT1);
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_VER);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("navy");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex5.php
Normal file
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex5.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(4,8,6);
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(25,15,25,25);
|
||||
|
||||
$graph->title->Set('"GRAD_WIDE_MIDVER"');
|
||||
$graph->title->SetColor('darkred');
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_FONT1);
|
||||
$graph->yaxis->SetFont(FF_FONT1);
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_WIDE_MIDVER);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("navy");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex6.php
Normal file
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex6.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(4,8,6);
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(25,15,25,25);
|
||||
|
||||
$graph->title->Set('"GRAD_WIDE_MIDHOR"');
|
||||
$graph->title->SetColor('darkred');
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_FONT1);
|
||||
$graph->yaxis->SetFont(FF_FONT1);
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_WIDE_MIDHOR);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("navy");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex7.php
Normal file
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex7.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(4,8,6);
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(25,15,25,25);
|
||||
|
||||
$graph->title->Set('"GRAD_CENTER"');
|
||||
$graph->title->SetColor('darkred');
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_FONT1);
|
||||
$graph->yaxis->SetFont(FF_FONT1);
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient("navy","lightsteelblue",GRAD_CENTER);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("navy");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex8.php
Normal file
34
OLD/OLD Trends/trends/src/Examples/bargradsmallex8.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// We need some data
|
||||
$datay=array(4,8,6);
|
||||
|
||||
// Setup the graph.
|
||||
$graph = new Graph(200,150);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(25,15,25,25);
|
||||
|
||||
$graph->title->Set('"GRAD_RAISED_PANEL"');
|
||||
$graph->title->SetColor('darkred');
|
||||
|
||||
// Setup font for axis
|
||||
$graph->xaxis->SetFont(FF_FONT1);
|
||||
$graph->yaxis->SetFont(FF_FONT1);
|
||||
|
||||
// Create the bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
// Setup color for gradient fill style
|
||||
$bplot->SetFillGradient('navy','orange',GRAD_RAISED_PANEL);
|
||||
|
||||
// Set color for the frame of each bar
|
||||
$bplot->SetColor("navy");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally send the graph to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
29
OLD/OLD Trends/trends/src/Examples/barimgex1.php
Normal file
29
OLD/OLD Trends/trends/src/Examples/barimgex1.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
$datay=array(5,3,11,6,3);
|
||||
|
||||
$graph = new Graph(400,300,'auto');
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
$graph->title->Set('Images on top of bars');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,13);
|
||||
|
||||
$graph->SetTitleBackground('lightblue:1.1',TITLEBKG_STYLE1,TITLEBKG_FRAME_BEVEL);
|
||||
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetFillColor("orange");
|
||||
$bplot->SetWidth(0.5);
|
||||
|
||||
$lplot = new LinePlot($datay);
|
||||
$lplot->SetColor('white@1');
|
||||
$lplot->SetBarCenter();
|
||||
$lplot->mark->SetType(MARK_IMG_LBALL,'red');
|
||||
|
||||
$graph->Add($bplot);
|
||||
$graph->Add($lplot);
|
||||
|
||||
$graph->Stroke();
|
||||
?>
|
||||
48
OLD/OLD Trends/trends/src/Examples/barintex1.php
Normal file
48
OLD/OLD Trends/trends/src/Examples/barintex1.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// $Id: barintex1.php,v 1.3 2002/07/11 23:27:28 aditus Exp $
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// Some data
|
||||
$datay=array(1,1,0.5);
|
||||
|
||||
// Create the graph and setup the basic parameters
|
||||
$graph = new Graph(460,200,'auto');
|
||||
$graph->img->SetMargin(40,30,30,40);
|
||||
$graph->SetScale("textint");
|
||||
$graph->SetShadow();
|
||||
$graph->SetFrame(false); // No border around the graph
|
||||
|
||||
// Add some grace to the top so that the scale doesn't
|
||||
// end exactly at the max value.
|
||||
$graph->yaxis->scale->SetGrace(100);
|
||||
|
||||
// Setup X-axis labels
|
||||
$a = $gDateLocale->GetShortMonth();
|
||||
$graph->xaxis->SetTickLabels($a);
|
||||
$graph->xaxis->SetFont(FF_FONT2);
|
||||
|
||||
// Setup graph title ands fonts
|
||||
$graph->title->Set("Example of integer Y-scale");
|
||||
$graph->title->SetFont(FF_FONT2,FS_BOLD);
|
||||
$graph->xaxis->title->Set("Year 2002");
|
||||
$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD);
|
||||
|
||||
// Create a bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetFillColor("orange");
|
||||
$bplot->SetWidth(0.5);
|
||||
$bplot->SetShadow();
|
||||
|
||||
// Setup the values that are displayed on top of each bar
|
||||
$bplot->value->Show();
|
||||
// Must use TTF fonts if we want text at an arbitrary angle
|
||||
$bplot->value->SetFont(FF_ARIAL,FS_BOLD);
|
||||
$bplot->value->SetAngle(45);
|
||||
// Black color for positive values and darkred for negative values
|
||||
$bplot->value->SetColor("black","darkred");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally stroke the graph
|
||||
$graph->Stroke();
|
||||
?>
|
||||
57
OLD/OLD Trends/trends/src/Examples/barintex2.php
Normal file
57
OLD/OLD Trends/trends/src/Examples/barintex2.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// Some data
|
||||
$datay=array(3,7,19,11,4,20);
|
||||
|
||||
// Create the graph and setup the basic parameters
|
||||
$graph = new Graph(350,200,'auto');
|
||||
$graph->img->SetMargin(40,30,40,40);
|
||||
$graph->SetScale("textint");
|
||||
$graph->SetFrame(true,'blue',1);
|
||||
$graph->SetColor('lightblue');
|
||||
$graph->SetMarginColor('lightblue');
|
||||
|
||||
// Add some grace to the top so that the scale doesn't
|
||||
// end exactly at the max value.
|
||||
//$graph->yaxis->scale->SetGrace(20);
|
||||
|
||||
// Setup X-axis labels
|
||||
$a = $gDateLocale->GetShortMonth();
|
||||
$graph->xaxis->SetTickLabels($a);
|
||||
$graph->xaxis->SetFont(FF_FONT1);
|
||||
$graph->xaxis->SetColor('darkblue','black');
|
||||
|
||||
// Stup "hidden" y-axis by given it the same color
|
||||
// as the background
|
||||
$graph->yaxis->SetColor('lightblue','darkblue');
|
||||
$graph->ygrid->SetColor('white');
|
||||
|
||||
// Setup graph title ands fonts
|
||||
$graph->title->Set('Example of integer Y-scale');
|
||||
$graph->subtitle->Set('(With "hidden" y-axis)');
|
||||
|
||||
$graph->title->SetFont(FF_FONT2,FS_BOLD);
|
||||
$graph->xaxis->title->Set("Year 2002");
|
||||
$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD);
|
||||
|
||||
// Create a bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetFillColor('darkblue');
|
||||
$bplot->SetColor('darkblue');
|
||||
$bplot->SetWidth(0.5);
|
||||
$bplot->SetShadow('darkgray');
|
||||
|
||||
// Setup the values that are displayed on top of each bar
|
||||
$bplot->value->Show();
|
||||
// Must use TTF fonts if we want text at an arbitrary angle
|
||||
$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,8);
|
||||
$bplot->value->SetFormat('$%d');
|
||||
// Black color for positive values and darkred for negative values
|
||||
$bplot->value->SetColor("black","darkred");
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally stroke the graph
|
||||
$graph->Stroke();
|
||||
?>
|
||||
42
OLD/OLD Trends/trends/src/Examples/barline_csimex1.php
Normal file
42
OLD/OLD Trends/trends/src/Examples/barline_csimex1.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
$ydata = array(2,3,4,5,6,7,8,9,10,11);
|
||||
$ydata2 = array(1,2,3,4,5,6,7,8,9,10);
|
||||
$targ = array("#1","#2","#3","#4","#5","#6","#7","#8","#9","#10");
|
||||
$alt = array(1,2,3,4,5,6,7,8,9,10);
|
||||
|
||||
// Create the graph.
|
||||
$graph = new Graph(300,200);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->img->SetMargin(40,20,30,40);
|
||||
$graph->title->Set("CSIM example with bar and line");
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Setup axis titles
|
||||
$graph->xaxis->title->Set("X-title");
|
||||
$graph->yaxis->title->Set("Y-title");
|
||||
|
||||
// Create the linear plot
|
||||
$lineplot=new LinePlot($ydata);
|
||||
$lineplot->mark->SetType(MARK_FILLEDCIRCLE);
|
||||
$lineplot->mark->SetWidth(5);
|
||||
$lineplot->mark->SetColor('black');
|
||||
$lineplot->mark->SetFillColor('red');
|
||||
$lineplot->SetCSIMTargets($targ,$alt);
|
||||
|
||||
// Create line plot
|
||||
$barplot=new barPlot($ydata2);
|
||||
$barplot->SetCSIMTargets($targ,$alt);
|
||||
|
||||
// Add the plots to the graph
|
||||
$graph->Add($lineplot);
|
||||
$graph->Add($barplot);
|
||||
|
||||
$graph->StrokeCSIM();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
74
OLD/OLD Trends/trends/src/Examples/barlinealphaex1.php
Normal file
74
OLD/OLD Trends/trends/src/Examples/barlinealphaex1.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
// Some "random" data
|
||||
$ydata = array(10,120,80,190,260,170,60,40,20,230);
|
||||
$ydata2 = array(10,70,40,120,200,60,80,40,20,5);
|
||||
|
||||
// Get a list of month using the current locale
|
||||
$months = $gDateLocale->GetShortMonth();
|
||||
|
||||
// Create the graph.
|
||||
$graph = new Graph(300,200);
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetMarginColor('white');
|
||||
|
||||
// Adjust the margin slightly so that we use the
|
||||
// entire area (since we don't use a frame)
|
||||
$graph->SetMargin(30,1,20,5);
|
||||
|
||||
// Box around plotarea
|
||||
$graph->SetBox();
|
||||
|
||||
// No frame around the image
|
||||
$graph->SetFrame(false);
|
||||
|
||||
// Setup the tab title
|
||||
$graph->tabtitle->Set('Year 2003');
|
||||
$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,10);
|
||||
|
||||
// Setup the X and Y grid
|
||||
$graph->ygrid->SetFill(true,'#DDDDDD@0.5','#BBBBBB@0.5');
|
||||
$graph->ygrid->SetLineStyle('dashed');
|
||||
$graph->ygrid->SetColor('gray');
|
||||
$graph->xgrid->Show();
|
||||
$graph->xgrid->SetLineStyle('dashed');
|
||||
$graph->xgrid->SetColor('gray');
|
||||
|
||||
// Setup month as labels on the X-axis
|
||||
$graph->xaxis->SetTickLabels($months);
|
||||
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8);
|
||||
$graph->xaxis->SetLabelAngle(45);
|
||||
|
||||
// Create a bar pot
|
||||
$bplot = new BarPlot($ydata);
|
||||
$bplot->SetWidth(0.6);
|
||||
$fcol='#440000';
|
||||
$tcol='#FF9090';
|
||||
|
||||
$bplot->SetFillGradient($fcol,$tcol,GRAD_LEFT_REFLECTION);
|
||||
|
||||
// Set line weigth to 0 so that there are no border
|
||||
// around each bar
|
||||
$bplot->SetWeight(0);
|
||||
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Create filled line plot
|
||||
$lplot = new LinePlot($ydata2);
|
||||
$lplot->SetFillColor('skyblue@0.5');
|
||||
$lplot->SetColor('navy@0.7');
|
||||
$lplot->SetBarCenter();
|
||||
|
||||
$lplot->mark->SetType(MARK_SQUARE);
|
||||
$lplot->mark->SetColor('blue@0.5');
|
||||
$lplot->mark->SetFillColor('lightblue');
|
||||
$lplot->mark->SetSize(6);
|
||||
|
||||
$graph->Add($lplot);
|
||||
|
||||
// .. and finally send it back to the browser
|
||||
$graph->Stroke();
|
||||
?>
|
||||
100
OLD/OLD Trends/trends/src/Examples/barlinefreq_csimex1.php
Normal file
100
OLD/OLD Trends/trends/src/Examples/barlinefreq_csimex1.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
//
|
||||
// Example of CSIM frequence bar that uses the cache
|
||||
//
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
|
||||
// Utility function to calculate the accumulated frequence
|
||||
// for a set of values and ocurrences
|
||||
function accfreq($data) {
|
||||
rsort($data);
|
||||
$s = array_sum($data);
|
||||
$as = array($data[0]);
|
||||
$asp = array(100*$as[0]/$s);
|
||||
$n = count($data);
|
||||
for( $i=1; $i < $n; ++$i ) {
|
||||
$as[$i] = $as[$i-1]+$data[$i];
|
||||
$asp[$i] = 100.0*$as[$i]/$s;
|
||||
}
|
||||
return $asp;
|
||||
}
|
||||
|
||||
// some data
|
||||
$data_freq = array(22,20,12,10,5,4,2);
|
||||
$data_accfreq = accfreq($data_freq);
|
||||
|
||||
// Create the graph.
|
||||
$graph = new Graph(350,250);
|
||||
|
||||
// We need to make this extra call for CSIM scripts
|
||||
// that make use of the cache. If the cache contains this
|
||||
// graph the HTML wrapper will be returned and then the
|
||||
// method will call exit() and hence NO LINES AFTER THIS
|
||||
// CALL WILL BE EXECUTED.
|
||||
// $graph->CheckCSIMCache('auto');
|
||||
|
||||
// Setup some basic graph parameters
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetY2Scale('lin',0,100);
|
||||
$graph->img->SetMargin(50,70,30,40);
|
||||
$graph->yaxis->SetTitleMargin(30);
|
||||
$graph->SetMarginColor('#EEEEEE');
|
||||
|
||||
// Setup titles and fonts
|
||||
$graph->title->Set("Frequence plot");
|
||||
$graph->xaxis->title->Set("X-title");
|
||||
$graph->yaxis->title->Set("Y-title");
|
||||
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Turn the tickmarks
|
||||
$graph->xaxis->SetTickSide(SIDE_DOWN);
|
||||
$graph->yaxis->SetTickSide(SIDE_LEFT);
|
||||
|
||||
$graph->y2axis->SetTickSide(SIDE_RIGHT);
|
||||
$graph->y2axis->SetColor('black','blue');
|
||||
$graph->y2axis->SetLabelFormat('%3d.0%%');
|
||||
|
||||
// Create a bar pot
|
||||
$bplot = new BarPlot($data_freq);
|
||||
|
||||
// Create targets and alt texts for the image maps. One for each bar
|
||||
// (In this example this is just "dummy" targets)
|
||||
$targ=array("#1","#2","#3","#4","#5","#6","#7");
|
||||
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
|
||||
$bplot->SetCSIMTargets($targ,$alts);
|
||||
|
||||
|
||||
// Create accumulative graph
|
||||
$lplot = new LinePlot($data_accfreq);
|
||||
|
||||
// We want the line plot data point in the middle of the bars
|
||||
$lplot->SetBarCenter();
|
||||
|
||||
// Use transperancy
|
||||
$lplot->SetFillColor('lightblue@0.6');
|
||||
$lplot->SetColor('blue@0.6');
|
||||
//$lplot->SetColor('blue');
|
||||
$graph->AddY2($lplot);
|
||||
|
||||
|
||||
// Setup the bars
|
||||
$bplot->SetFillColor("orange@0.2");
|
||||
$bplot->SetValuePos('center');
|
||||
$bplot->value->SetFormat("%d");
|
||||
$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$bplot->value->Show();
|
||||
|
||||
// Add it to the graph
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Send back the HTML page which will call this script again
|
||||
// to retrieve the image.
|
||||
$graph->StrokeCSIM();
|
||||
|
||||
?>
|
||||
83
OLD/OLD Trends/trends/src/Examples/barlinefreqex1.php
Normal file
83
OLD/OLD Trends/trends/src/Examples/barlinefreqex1.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
//
|
||||
// Example of frequence bar
|
||||
//
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
// Utility function to calculate the accumulated frequence
|
||||
// for a set of values and ocurrences
|
||||
function accfreq($data) {
|
||||
rsort($data);
|
||||
$s = array_sum($data);
|
||||
$as = array($data[0]);
|
||||
$asp = array(100*$as[0]/$s);
|
||||
$n = count($data);
|
||||
for( $i=1; $i < $n; ++$i ) {
|
||||
$as[$i] = $as[$i-1]+$data[$i];
|
||||
$asp[$i] = 100.0*$as[$i]/$s;
|
||||
}
|
||||
return $asp;
|
||||
}
|
||||
|
||||
// some data
|
||||
$data_freq = array(22,20,12,10,5,4,2);
|
||||
$data_accfreq = accfreq($data_freq);
|
||||
|
||||
// Create the graph.
|
||||
$graph = new Graph(350,250);
|
||||
|
||||
// Setup some basic graph parameters
|
||||
$graph->SetScale("textlin");
|
||||
$graph->SetY2Scale('lin',0,100);
|
||||
$graph->img->SetMargin(50,70,30,40);
|
||||
$graph->yaxis->SetTitleMargin(30);
|
||||
$graph->SetMarginColor('#EEEEEE');
|
||||
|
||||
// Setup titles and fonts
|
||||
$graph->title->Set("Frequence plot");
|
||||
$graph->xaxis->title->Set("X-title");
|
||||
$graph->yaxis->title->Set("Y-title");
|
||||
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Turn the tickmarks
|
||||
$graph->xaxis->SetTickSide(SIDE_DOWN);
|
||||
$graph->yaxis->SetTickSide(SIDE_LEFT);
|
||||
|
||||
$graph->y2axis->SetTickSide(SIDE_RIGHT);
|
||||
$graph->y2axis->SetColor('black','blue');
|
||||
$graph->y2axis->SetLabelFormat('%3d.0%%');
|
||||
|
||||
// Create a bar pot
|
||||
$bplot = new BarPlot($data_freq);
|
||||
|
||||
// Create accumulative graph
|
||||
$lplot = new LinePlot($data_accfreq);
|
||||
|
||||
// We want the line plot data point in the middle of the bars
|
||||
$lplot->SetBarCenter();
|
||||
|
||||
// Use transperancy
|
||||
$lplot->SetFillColor('lightblue@0.6');
|
||||
$lplot->SetColor('blue@0.6');
|
||||
$graph->AddY2($lplot);
|
||||
|
||||
// Setup the bars
|
||||
$bplot->SetFillColor("orange@0.2");
|
||||
$bplot->SetValuePos('center');
|
||||
$bplot->value->SetFormat("%d");
|
||||
$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9);
|
||||
$bplot->value->Show();
|
||||
|
||||
// Add it to the graph
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Send back the HTML page which will call this script again
|
||||
// to retrieve the image.
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
33
OLD/OLD Trends/trends/src/Examples/barpatternex1.php
Normal file
33
OLD/OLD Trends/trends/src/Examples/barpatternex1.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
|
||||
$datay=array(2,3,5,8.5,11.5,6,3);
|
||||
|
||||
// Create the graph.
|
||||
$graph = new Graph(350,300);
|
||||
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
$graph->SetMarginColor('navy:1.9');
|
||||
$graph->SetBox();
|
||||
|
||||
$graph->title->Set('Bar Pattern');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,20);
|
||||
|
||||
$graph->SetTitleBackground('lightblue:1.3',TITLEBKG_STYLE2,TITLEBKG_FRAME_BEVEL);
|
||||
$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'lightblue','blue');
|
||||
|
||||
// Create a bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetFillColor('darkorange');
|
||||
$bplot->SetWidth(0.6);
|
||||
|
||||
$bplot->SetPattern(PATTERN_CROSS1,'navy');
|
||||
|
||||
$graph->Add($bplot);
|
||||
|
||||
$graph->Stroke();
|
||||
?>
|
||||
63
OLD/OLD Trends/trends/src/Examples/barscalecallbackex1.php
Normal file
63
OLD/OLD Trends/trends/src/Examples/barscalecallbackex1.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// Callback function for Y-scale to get 1000 separator on labels
|
||||
function separator1000($aVal) {
|
||||
return number_format($aVal);
|
||||
}
|
||||
|
||||
function separator1000_usd($aVal) {
|
||||
return '$'.number_format($aVal);
|
||||
}
|
||||
|
||||
// Some data
|
||||
$datay=array(120567,134013,192000,87000);
|
||||
|
||||
// Create the graph and setup the basic parameters
|
||||
$graph = new Graph(500,300,'auto');
|
||||
$graph->img->SetMargin(80,30,30,40);
|
||||
$graph->SetScale('textint');
|
||||
$graph->SetShadow();
|
||||
$graph->SetFrame(false); // No border around the graph
|
||||
|
||||
// Add some grace to the top so that the scale doesn't
|
||||
// end exactly at the max value.
|
||||
// The grace value is the percetage of additional scale
|
||||
// value we add. Specifying 50 means that we add 50% of the
|
||||
// max value
|
||||
$graph->yaxis->scale->SetGrace(50);
|
||||
$graph->yaxis->SetLabelFormatCallback('separator1000');
|
||||
|
||||
// Setup X-axis labels
|
||||
$a = $gDateLocale->GetShortMonth();
|
||||
$graph->xaxis->SetTickLabels($a);
|
||||
$graph->xaxis->SetFont(FF_FONT2);
|
||||
|
||||
// Setup graph title ands fonts
|
||||
$graph->title->Set('Example of Y-scale callback formatting');
|
||||
$graph->title->SetFont(FF_FONT2,FS_BOLD);
|
||||
$graph->xaxis->title->Set('Year 2002');
|
||||
$graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD);
|
||||
|
||||
// Create a bar pot
|
||||
$bplot = new BarPlot($datay);
|
||||
$bplot->SetFillColor('orange');
|
||||
$bplot->SetWidth(0.5);
|
||||
$bplot->SetShadow();
|
||||
|
||||
// Setup the values that are displayed on top of each bar
|
||||
$bplot->value->Show();
|
||||
|
||||
// Must use TTF fonts if we want text at an arbitrary angle
|
||||
$bplot->value->SetFont(FF_ARIAL,FS_BOLD);
|
||||
$bplot->value->SetAngle(45);
|
||||
$bplot->value->SetFormatCallback('separator1000_usd');
|
||||
|
||||
// Black color for positive values and darkred for negative values
|
||||
$bplot->value->SetColor('black','darkred');
|
||||
$graph->Add($bplot);
|
||||
|
||||
// Finally stroke the graph
|
||||
$graph->Stroke();
|
||||
?>
|
||||
35
OLD/OLD Trends/trends/src/Examples/bartutex1.php
Normal file
35
OLD/OLD Trends/trends/src/Examples/bartutex1.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// Some data
|
||||
$databary=array(12,7,16,5,7,14,9,3);
|
||||
|
||||
// New graph with a drop shadow
|
||||
$graph = new Graph(300,200);
|
||||
$graph->SetShadow();
|
||||
|
||||
// Use a "text" X-scale
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
// Set title and subtitle
|
||||
$graph->title->Set("Elementary barplot with a text scale");
|
||||
|
||||
// Use built in font
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Create the bar plot
|
||||
$b1 = new BarPlot($databary);
|
||||
$b1->SetLegend("Temperature");
|
||||
//$b1->SetAbsWidth(6);
|
||||
//$b1->SetShadow();
|
||||
|
||||
// The order the plots are added determines who's ontop
|
||||
$graph->Add($b1);
|
||||
|
||||
// Finally output the image
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
90
OLD/OLD Trends/trends/src/Examples/bartutex12.php
Normal file
90
OLD/OLD Trends/trends/src/Examples/bartutex12.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// A medium complex example of JpGraph
|
||||
// Note: You can create a graph in far fewwr lines of code if you are
|
||||
// willing to go with the defaults. This is an illustrative example of
|
||||
// some of the capabilities of JpGraph.
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_line.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
$month=array(
|
||||
"Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec");
|
||||
|
||||
// Create some datapoints
|
||||
$steps=100;
|
||||
for($i=0; $i<$steps; ++$i) {
|
||||
$databarx[]=sprintf("198%d %s",floor($i/12),$month[$i%12]);
|
||||
$datay[$i]=log(pow($i,$i/10)+1)*sin($i/15)+35;
|
||||
if( $i % 6 == 0 && $i<$steps-6) {
|
||||
$databary[]=abs(25*sin($i)+5);
|
||||
}
|
||||
else {
|
||||
$databary[]=0;
|
||||
}
|
||||
}
|
||||
|
||||
// New graph with a background image and drop shadow
|
||||
$graph = new Graph(450,300);
|
||||
$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);
|
||||
$graph->SetShadow();
|
||||
|
||||
// Use text X-scale so we can text labels on the X-axis
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
// Y2-axis is linear
|
||||
$graph->SetY2Scale("lin");
|
||||
|
||||
// Color the two Y-axis to make them easier to associate
|
||||
// to the corresponding plot (we keep the axis black though)
|
||||
$graph->yaxis->SetColor("black","red");
|
||||
$graph->y2axis->SetColor("black","orange");
|
||||
|
||||
// Set title and subtitle
|
||||
$graph->title->Set("Combined bar and line plot");
|
||||
$graph->subtitle->Set("100 data points, X-Scale: 'text'");
|
||||
|
||||
// Use built in font (don't need TTF support)
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Make the margin around the plot a little bit bigger then default
|
||||
$graph->img->SetMargin(40,140,40,80);
|
||||
|
||||
// Slightly adjust the legend from it's default position in the
|
||||
// top right corner to middle right side
|
||||
$graph->legend->Pos(0.03,0.5,"right","center");
|
||||
|
||||
// Display every 6:th tickmark
|
||||
$graph->xaxis->SetTextTickInterval(6);
|
||||
|
||||
// Label every 2:nd tick mark
|
||||
$graph->xaxis->SetTextLabelInterval(2);
|
||||
|
||||
// Setup the labels
|
||||
$graph->xaxis->SetTickLabels($databarx);
|
||||
$graph->xaxis->SetLabelAngle(90);
|
||||
|
||||
// Create a red line plot
|
||||
$p1 = new LinePlot($datay);
|
||||
$p1->SetColor("red");
|
||||
$p1->SetLegend("Pressure");
|
||||
|
||||
// Create the bar plot
|
||||
$b1 = new BarPlot($databary);
|
||||
$b1->SetLegend("Temperature");
|
||||
$b1->SetFillColor("orange");
|
||||
$b1->SetAbsWidth(8);
|
||||
|
||||
// Drop shadow on bars adjust the default values a little bit
|
||||
$b1->SetShadow("steelblue",2,2);
|
||||
|
||||
// The order the plots are added determines who's ontop
|
||||
$graph->Add($p1);
|
||||
$graph->AddY2($b1);
|
||||
|
||||
// Finally output the image
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
40
OLD/OLD Trends/trends/src/Examples/bartutex2.php
Normal file
40
OLD/OLD Trends/trends/src/Examples/bartutex2.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// Some data
|
||||
$databary=array(12,7,16,6,7,14,9,3);
|
||||
$months=$gDateLocale->GetShortMonth();
|
||||
|
||||
// New graph with a drop shadow
|
||||
$graph = new Graph(300,200,'auto');
|
||||
$graph->SetShadow();
|
||||
|
||||
// Use a "text" X-scale
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
// Specify X-labels
|
||||
$graph->xaxis->SetTickLabels($months);
|
||||
|
||||
// Set title and subtitle
|
||||
$graph->title->Set("Textscale with specified labels");
|
||||
|
||||
// Use built in font
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Create the bar plot
|
||||
$b1 = new BarPlot($databary);
|
||||
$b1->SetLegend("Temperature");
|
||||
|
||||
//$b1->SetAbsWidth(6);
|
||||
//$b1->SetShadow();
|
||||
|
||||
// The order the plots are added determines who's ontop
|
||||
$graph->Add($b1);
|
||||
|
||||
// Finally output the image
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
44
OLD/OLD Trends/trends/src/Examples/bartutex3.php
Normal file
44
OLD/OLD Trends/trends/src/Examples/bartutex3.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// Some data
|
||||
$months=$gDateLocale->GetShortMonth();
|
||||
|
||||
srand ((double) microtime() * 1000000);
|
||||
for( $i=0; $i<25; ++$i) {
|
||||
$databary[]=rand(1,50);
|
||||
$databarx[]=$months[$i%12];
|
||||
}
|
||||
|
||||
// New graph with a drop shadow
|
||||
$graph = new Graph(300,200,'auto');
|
||||
$graph->SetShadow();
|
||||
|
||||
// Use a "text" X-scale
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
// Specify X-labels
|
||||
$graph->xaxis->SetTickLabels($databarx);
|
||||
|
||||
// Set title and subtitle
|
||||
$graph->title->Set("Bar tutorial example 3");
|
||||
|
||||
// Use built in font
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Create the bar plot
|
||||
$b1 = new BarPlot($databary);
|
||||
$b1->SetLegend("Temperature");
|
||||
//$b1->SetAbsWidth(6);
|
||||
//$b1->SetShadow();
|
||||
|
||||
// The order the plots are added determines who's ontop
|
||||
$graph->Add($b1);
|
||||
|
||||
// Finally output the image
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
47
OLD/OLD Trends/trends/src/Examples/bartutex4.php
Normal file
47
OLD/OLD Trends/trends/src/Examples/bartutex4.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// Some data
|
||||
$months=$gDateLocale->GetShortMonth();
|
||||
|
||||
srand ((double) microtime() * 1000000);
|
||||
for( $i=0; $i<25; ++$i) {
|
||||
$databary[]=rand(1,50);
|
||||
$databarx[]=$months[$i%12];
|
||||
}
|
||||
|
||||
// New graph with a drop shadow
|
||||
$graph = new Graph(300,200,'auto');
|
||||
$graph->SetShadow();
|
||||
|
||||
// Use a "text" X-scale
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
// Specify X-labels
|
||||
//$databarx = array('tXi','','','xxx','','','iXii','','','OOO','','','tOO');
|
||||
$graph->xaxis->SetFont(FF_FONT1,FS_NORMAL);
|
||||
$graph->xaxis->SetTickLabels($databarx);
|
||||
$graph->xaxis->SetTextLabelInterval(3);
|
||||
|
||||
// Set title and subtitle
|
||||
$graph->title->Set("Displaying only every third label");
|
||||
|
||||
// Use built in font
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Create the bar plot
|
||||
$b1 = new BarPlot($databary);
|
||||
$b1->SetLegend("Temperature");
|
||||
//$b1->SetAbsWidth(6);
|
||||
//$b1->SetShadow();
|
||||
|
||||
// The order the plots are added determines who's ontop
|
||||
$graph->Add($b1);
|
||||
|
||||
// Finally output the image
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
45
OLD/OLD Trends/trends/src/Examples/bartutex5.php
Normal file
45
OLD/OLD Trends/trends/src/Examples/bartutex5.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// Some data
|
||||
$months=$gDateLocale->GetShortMonth();
|
||||
|
||||
srand ((double) microtime() * 1000000);
|
||||
for( $i=0; $i<25; ++$i) {
|
||||
$databary[]=rand(1,50);
|
||||
$databarx[]=$months[$i%12];
|
||||
}
|
||||
|
||||
// New graph with a drop shadow
|
||||
$graph = new Graph(300,200,'auto');
|
||||
$graph->SetShadow();
|
||||
|
||||
// Use a "text" X-scale
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
// Specify X-labels
|
||||
$graph->xaxis->SetTickLabels($databarx);
|
||||
$graph->xaxis->SetTextLabelInterval(1);
|
||||
$graph->xaxis->SetTextTickInterval(3);
|
||||
|
||||
// Set title and subtitle
|
||||
$graph->title->Set("Bar tutorial example 5");
|
||||
|
||||
// Use built in font
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Create the bar plot
|
||||
$b1 = new BarPlot($databary);
|
||||
$b1->SetLegend("Temperature");
|
||||
$b1->SetWidth(0.4);
|
||||
|
||||
// The order the plots are added determines who's ontop
|
||||
$graph->Add($b1);
|
||||
|
||||
// Finally output the image
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
47
OLD/OLD Trends/trends/src/Examples/bartutex6.php
Normal file
47
OLD/OLD Trends/trends/src/Examples/bartutex6.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_bar.php');
|
||||
|
||||
// Some data
|
||||
$months=$gDateLocale->GetShortMonth();
|
||||
srand ((double) microtime() * 1000000);
|
||||
for( $i=0; $i<25; ++$i) {
|
||||
$databary[]=rand(1,50);
|
||||
$databarx[]=$months[$i%12];
|
||||
}
|
||||
|
||||
// New graph with a drop shadow
|
||||
$graph = new Graph(300,200,'auto');
|
||||
$graph->SetShadow();
|
||||
|
||||
// Use a "text" X-scale
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
// Specify X-labels
|
||||
$graph->xaxis->SetTickLabels($databarx);
|
||||
$graph->xaxis->SetTextLabelInterval(3);
|
||||
|
||||
// Hide the tick marks
|
||||
$graph->xaxis->HideTicks();
|
||||
|
||||
// Set title and subtitle
|
||||
$graph->title->Set("Bar tutorial example 6");
|
||||
|
||||
// Use built in font
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Create the bar plot
|
||||
$b1 = new BarPlot($databary);
|
||||
$b1->SetLegend("Temperature");
|
||||
$b1->SetWidth(0.4);
|
||||
|
||||
|
||||
// The order the plots are added determines who's ontop
|
||||
$graph->Add($b1);
|
||||
|
||||
// Finally output the image
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
40
OLD/OLD Trends/trends/src/Examples/basic_contourex01.php
Normal file
40
OLD/OLD Trends/trends/src/Examples/basic_contourex01.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Basic contour plot example
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_contour.php');
|
||||
|
||||
$data = array(
|
||||
array (0.5,1.1,1.5,1,2.0,3,3,2,1,0.1),
|
||||
array (1.0,1.5,3.0,5,6.0,2,1,1.2,1,4),
|
||||
array (0.9,2.0,2.1,3,6.0,7,3,2,1,1.4),
|
||||
array (1.0,1.5,3.0,4,6.0,5,2,1.5,1,2),
|
||||
array (0.8,2.0,3.0,3,4.0,4,3,2.4,2,3),
|
||||
array (0.6,1.1,1.5,1,4.0,3.5,3,2,3,4),
|
||||
array (1.0,1.5,3.0,5,6.0,2,1,1.2,2.7,4),
|
||||
array (0.8,2.0,3.0,3,5.5,6,3,2,1,1.4),
|
||||
array (1.0,1.5,3.0,4,6.0,5,2,1,0.5,0.2));
|
||||
|
||||
// Basic contour graph
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale('intint');
|
||||
|
||||
// Adjust the margins to fit the margin
|
||||
$graph->SetMargin(30,100,40,30);
|
||||
|
||||
// Setup
|
||||
$graph->title->Set('Basic contour plot');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
// A simple contour plot with default arguments (e.g. 10 isobar lines)
|
||||
$cp = new ContourPlot($data);
|
||||
|
||||
// Display the legend
|
||||
$cp->ShowLegend();
|
||||
|
||||
$graph->Add($cp);
|
||||
|
||||
// ... and send the graph back to the browser
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
43
OLD/OLD Trends/trends/src/Examples/basic_contourex02.php
Normal file
43
OLD/OLD Trends/trends/src/Examples/basic_contourex02.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Basic contour plot example
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_contour.php');
|
||||
|
||||
$data = array(
|
||||
array (0.5,1.1,1.5,1,2.0,3,3,2,1,0.1),
|
||||
array (1.0,1.5,3.0,5,6.0,2,1,1.2,1,4),
|
||||
array (0.9,2.0,2.1,3,6.0,7,3,2,1,1.4),
|
||||
array (1.0,1.5,3.0,4,6.0,5,2,1.5,1,2),
|
||||
array (0.8,2.0,3.0,3,4.0,4,3,2.4,2,3),
|
||||
array (0.6,1.1,1.5,1,4.0,3.5,3,2,3,4),
|
||||
array (1.0,1.5,3.0,5,6.0,2,1,1.2,2.7,4),
|
||||
array (0.8,2.0,3.0,3,5.5,6,3,2,1,1.4),
|
||||
array (1.0,1.5,3.0,4,6.0,5,2,1,0.5,0.2));
|
||||
|
||||
// Basic contour graph
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale('intint');
|
||||
|
||||
// Show axis on all sides
|
||||
$graph->SetAxisStyle(AXSTYLE_BOXOUT);
|
||||
|
||||
// Adjust the margins to fit the margin
|
||||
$graph->SetMargin(30,100,40,30);
|
||||
|
||||
// Setup
|
||||
$graph->title->Set('Basic contour plot with multiple axis');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
// A simple contour plot with default arguments (e.g. 10 isobar lines)
|
||||
$cp = new ContourPlot($data);
|
||||
|
||||
// Display the legend
|
||||
$cp->ShowLegend();
|
||||
|
||||
$graph->Add($cp);
|
||||
|
||||
// ... and send the graph back to the browser
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
40
OLD/OLD Trends/trends/src/Examples/basic_contourex03-1.php
Normal file
40
OLD/OLD Trends/trends/src/Examples/basic_contourex03-1.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Basic contour plot example
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_contour.php');
|
||||
|
||||
$data = array(
|
||||
array ( 12,7,3,15 ),
|
||||
array ( 18,5,1, 9 ),
|
||||
array ( 13,9,5,12),
|
||||
array ( 5,3,8, 9 ),
|
||||
array ( 1,8,5, 7 ));
|
||||
|
||||
|
||||
// Basic contour graph
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale('intint');
|
||||
|
||||
// Show axis on all sides
|
||||
$graph->SetAxisStyle(AXSTYLE_BOXOUT);
|
||||
|
||||
// Adjust the margins to fit the margin
|
||||
$graph->SetMargin(30,100,40,30);
|
||||
|
||||
// Setup
|
||||
$graph->title->Set('Basic contour plot with multiple axis');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
// A simple contour plot with default arguments (e.g. 10 isobar lines)
|
||||
$cp = new ContourPlot($data,10,1);
|
||||
|
||||
// Display the legend
|
||||
$cp->ShowLegend();
|
||||
|
||||
$graph->Add($cp);
|
||||
|
||||
// ... and send the graph back to the browser
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
40
OLD/OLD Trends/trends/src/Examples/basic_contourex03-2.php
Normal file
40
OLD/OLD Trends/trends/src/Examples/basic_contourex03-2.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Basic contour plot example
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_contour.php');
|
||||
|
||||
$data = array(
|
||||
array ( 12,7,3,15 ),
|
||||
array ( 18,5,1, 9 ),
|
||||
array ( 13,9,5,12),
|
||||
array ( 5,3,8, 9 ),
|
||||
array ( 1,8,5, 7 ));
|
||||
|
||||
|
||||
// Basic contour graph
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale('intint');
|
||||
|
||||
// Show axis on all sides
|
||||
$graph->SetAxisStyle(AXSTYLE_BOXOUT);
|
||||
|
||||
// Adjust the margins to fit the margin
|
||||
$graph->SetMargin(30,100,40,30);
|
||||
|
||||
// Setup
|
||||
$graph->title->Set('Basic contour plot with multiple axis');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
// A simple contour plot with default arguments (e.g. 10 isobar lines)
|
||||
$cp = new ContourPlot($data,10,2);
|
||||
|
||||
// Display the legend
|
||||
$cp->ShowLegend();
|
||||
|
||||
$graph->Add($cp);
|
||||
|
||||
// ... and send the graph back to the browser
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
40
OLD/OLD Trends/trends/src/Examples/basic_contourex03-3.php
Normal file
40
OLD/OLD Trends/trends/src/Examples/basic_contourex03-3.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php // content="text/plain; charset=utf-8"
|
||||
// Basic contour plot example
|
||||
|
||||
require_once ('jpgraph/jpgraph.php');
|
||||
require_once ('jpgraph/jpgraph_contour.php');
|
||||
|
||||
$data = array(
|
||||
array ( 12,7,3,15 ),
|
||||
array ( 18,5,1, 9 ),
|
||||
array ( 13,9,5,12),
|
||||
array ( 5,3,8, 9 ),
|
||||
array ( 1,8,5, 7 ));
|
||||
|
||||
|
||||
// Basic contour graph
|
||||
$graph = new Graph(350,250);
|
||||
$graph->SetScale('intint');
|
||||
|
||||
// Show axis on all sides
|
||||
$graph->SetAxisStyle(AXSTYLE_BOXOUT);
|
||||
|
||||
// Adjust the margins to fit the margin
|
||||
$graph->SetMargin(30,100,40,30);
|
||||
|
||||
// Setup
|
||||
$graph->title->Set('Basic contour plot with multiple axis');
|
||||
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
|
||||
|
||||
// A simple contour plot with default arguments (e.g. 10 isobar lines)
|
||||
$cp = new ContourPlot($data,10,3);
|
||||
|
||||
// Display the legend
|
||||
$cp->ShowLegend();
|
||||
|
||||
$graph->Add($cp);
|
||||
|
||||
// ... and send the graph back to the browser
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user