| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/projects/meteoca/ |
Upload File : |
<?php
/******************************
Project: MeteoCA, 2017-2020
Version: PHP-7
Author : M. Kukic
Note :
******************************/
include('phpgraphlib.php');
$n = $_GET["dt"];
$sir=100*$nams;
$vis=280;
//citanje file
$myfile = fopen($putanja."bar-ams.txt", "r") or die("Unable to open file!");
for ($k = 1; $k<=(9*($n-1)); $k++)
{
$t=1*fgets($myfile);
}
$data1["CA1"]=1*fgets($myfile);
$data2["CA1"]=1*fgets($myfile);
$data3["CA1"]=1*fgets($myfile);
$data1["CA2"]=1*fgets($myfile);
$data2["CA2"]=1*fgets($myfile);
$data3["CA2"]=1*fgets($myfile);
$data1["CA3"]=1*fgets($myfile);
$data2["CA3"]=1*fgets($myfile);
$data3["CA3"]=1*fgets($myfile);
/*
$data1["CA4"]=1*fgets($myfile);
$data2["CA4"]=1*fgets($myfile);
$data1["CA5"]=1*fgets($myfile);
$data2["CA6"]=1*fgets($myfile);
$data1["CA6"]=1*fgets($myfile);
$data2["CA6"]=1*fgets($myfile);
*/
$graph=new PHPGraphLib($sir,$vis);
$graph->addData($data1, $data2, $data3);
$graph->setBarColor('blue', 'green', 'lime');
if ($n==1) $graph->setRange(950,1025);
//
if ($n==1) $graph->setTitle('Baro [mb]');
if ($n==2) $graph->setTitle('Termo [C]');
if ($n==3) $graph->setTitle('Humi [%]');
if ($n==4) $graph->setTitle('Sun [%]');
if ($n==5) $graph->setTitle('Wind [bp/min]');
if ($n==6) $graph->setTitle('');
if ($n==7) $graph->setTitle('');
if ($n==8) $graph->setTitle('');
//
$graph->setupYAxis(12, 'blue');
$graph->setupXAxis(20);
//$graph->setGrid(false);
$graph->setGrid(true);
$graph->setLegend(true);
$graph->setTitleLocation('left');
$graph->setTitleColor('blue');
$graph->setLegendOutlineColor('white');
$graph->setLegendTitle('Min', 'Avr', 'Max');
$graph->setXValuesHorizontal(true);
if ($n==1) $graph->setGradient('blue', 'aqua');
if ($n==2) $graph->setGradient('red', 'maroon');
if ($n==3) $graph->setGradient('green', 'olive');
if ($n==4) $graph->setGradient('fuscia', 'purple');
if ($n==5) $graph->setGradient('gray', 'silver');
$graph->createGraph();
fclose($myfile);
?>