Page 12 of 17

Re: Cumulus Server Sided JpGraph Graphs

Posted: Tue 28 Apr 2009 4:26 pm
by pinto
inside each graph-script search for

Code: Select all

$graph->yaxis->SetLabelFormat('%01.0f ' 
change it to

Code: Select all


$graph->yaxis->SetLabelFormat('%01.1f ' 
or

Code: Select all

$graph->yaxis->SetLabelFormat('%01.2f ' 

Re: Cumulus Server Sided JpGraph Graphs

Posted: Wed 29 Apr 2009 3:50 am
by andro700
Jozef,

I how you big time. I did not know what that was for. Now I know. Very much appreciated.

Chuck

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 01 May 2009 4:53 pm
by i0i
Hello. Been collecting data for my jpgraphs since recieiving a weather station for Christmas :-)
Now got 4 months worth and want to see all of it in one graph. Would really appreciate some ideas, I work by reverse engineering these scripts and as a result have trouble getting them to do new things.

Here is one that I'm working on http://www.djmorgan.org.uk/weather/graphs/temp365.php
(it's to go with these http://www.djmorgan.org.uk/weather/graphs/graph.php)

I want the temp365 graph to draw a 365 data point x axis and gradually fill it during the year, rather than draw an x axis with 4 months of data and increase it in size each day.

Here is the php

--------------------------------------------

<?php

require_once("GraphSettings.php");
check_sourceview(); # Checks to see if Source View Was passed to the script

$rawdata = array_reverse( file("dayfile.txt"));

// $rawdata = str_replace("," , "." , $rawdata);
// $rawdata = str_replace(";" , " " , $rawdata);
// $rawdata = str_replace("/" , "-" , $rawdata);
$rawdata = str_replace("," , " " , $rawdata);
$rawdata = str_replace("/" , "-" , $rawdata);

$y1 = array();
$y2 = array();
$x = array();
$wanted = 366;
$got = 0;
foreach($rawdata as $key) {
if ($got < $wanted) {

list($date, $gust, $gustbearing, $Tgust, $mintemp, $Tmintemp, $maxtemp, $Tmaxtemp,
$minbaro, $Tminbaro, $maxbaro, $Tmaxbaro, $maxrainrate, $Tmaxrainrate, $dayrn,
$avgtemp, $windrun) = preg_split('/ +/', $key);
$y1[] = $maxtemp;
$y2[] = $mintemp;
$x[] = substr($date,0,2);
$got++;
}
}
$y1 = array_reverse($y1);
$y2 = array_reverse($y2);
$x = array_reverse($x);
#############################################################################################################""
$graph = new Graph(1200,500,365);
$graph->SetScale("textlin");
$graph->SetMarginColor($SITE['bgncolor']);
$graph->SetFrame(true,'#CDCABB',4);
$graph->img->SetMargin(45,40,20,55);

$barplot=new barplot($y1);
$barplot2=new barplot($y2);
$barplot->SetAlign("center");
$barplot->SetFillGradient("red","#EEEEEE",GRAD_LEFT_REFLECTION);
$barplot2->SetAlign("center");
$barplot2->SetFillGradient("blue","#EEEEEE",GRAD_LEFT_REFLECTION);

$graph->Add($barplot);
$graph->Add($barplot2);

// titles
$graph->title->SetFont(FF_VERDANA,FS_BOLD,8);
$graph->title->Set($SITE['sitename']);
$graph->title->SetColor("azure4");
$graph->title->SetPos(0.003,0.54,"left","top");

//x-axis
$graph->xaxis->SetColor($SITE['txtcolor']);
$graph->xaxis->SetTickLabels($x);
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,6);
$graph->xaxis->SetTextLabelInterval(2);
$graph->xaxis->HideTicks(true,true);
$graph->xaxis->SetPos("min");
$graph->xgrid->Show(true);
$graph->xscale->SetAutoMin(1);
$graph->xscale->SetAutoMax(365);

//y-axis
$graph->yaxis->SetColor($SITE['txtcolor']);
$graph->yaxis->SetLabelFormat('%0.0f' . " °C");
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,6);
$graph->yaxis->scale->SetGrace(20);
$graph->yaxis->HideTicks(true,true);

// Set the colors for the plots
$barplot->SetColor("red");
$barplot->SetWeight(1);
$barplot2->SetColor("blue");
$barplot2->SetWeight(1);

// Print Wording on graphic

$txt2=new Text("cumulus");
$txt2->SetFont(FF_VERDANA, FS_BOLD,35);
$txt2->ParagraphAlign('left');
$txt2->SetPos(0.003,0.54,"left","center");
$txt2->SetColor("azure4@0.85");
$txt2->SetAngle(90);
$graph->AddText($txt2);

$txt1=new Text("Min. Max. temperature day by day");
$txt1->SetFont( FF_VERDANA, FS_BOLD,12);
$txt1->ParagraphAlign('left');
$txt1->SetPos(0.11,0.93,"left","center");
$txt1->SetColor("azure4@0.6");
$graph->AddText($txt1);

$txt3=new Text(date("M j Y",time()));
$txt3->SetFont(FF_VERDANA, FS_BOLD,8);
$txt3->SetPos(0.78,0.015,"left","top");
$txt3->SetColor("azure4");
$graph->AddText($txt3);


// Display the graph
if (! $SITE['debug']) {
$graph->Stroke();
} else {
debug_out("Graph Creation complete. Graph output suppresed due to debug");
}

exit;

Re: Cumulus Server Sided JpGraph Graphs

Posted: Tue 09 Jun 2009 4:09 pm
by meteotortosa
Houston, we've a problem...

Code: Select all

[09-Jun-2009 10:55:44] PHP Warning:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/meteotor/public_html/liveview/realtimelog.php on line 93
[09-Jun-2009 10:55:44] PHP Warning:  file(/public_html/liveview/realtime.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 107
[09-Jun-2009 10:55:44] PHP Warning:  fopen(/public_html/liveview/realtime.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 131
[09-Jun-2009 10:56:44] PHP Warning:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/meteotor/public_html/liveview/realtimelog.php on line 93
[09-Jun-2009 10:56:44] PHP Warning:  file(/public_html/liveview/realtime.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 107
[09-Jun-2009 10:56:44] PHP Warning:  fopen(/public_html/liveview/realtime.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 131
[09-Jun-2009 10:57:44] PHP Warning:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/meteotor/public_html/liveview/realtimelog.php on line 93
[09-Jun-2009 10:57:44] PHP Warning:  file(/public_html/liveview/realtime.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 107
[09-Jun-2009 10:57:44] PHP Warning:  fopen(/public_html/liveview/realtime.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 131
[09-Jun-2009 10:58:44] PHP Warning:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/meteotor/public_html/liveview/realtimelog.php on line 93
[09-Jun-2009 10:58:44] PHP Warning:  file(/public_html/liveview/realtime.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 107
[09-Jun-2009 10:58:44] PHP Warning:  fopen(/public_html/liveview/realtime.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 131
[09-Jun-2009 10:59:44] PHP Warning:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/meteotor/public_html/liveview/realtimelog.php on line 93
[09-Jun-2009 10:59:44] PHP Warning:  file(/public_html/liveview/realtime.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 107
[09-Jun-2009 10:59:44] PHP Warning:  fopen(/public_html/liveview/realtime.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 131
[09-Jun-2009 11:00:19] PHP Warning:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/meteotor/public_html/liveview/realtimelog.php on line 93
[09-Jun-2009 11:00:19] PHP Warning:  file(/public_html/liveview/realtime.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 107
[09-Jun-2009 11:00:19] PHP Warning:  fopen(/public_html/liveview/realtime.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 131
[09-Jun-2009 11:00:44] PHP Warning:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/meteotor/public_html/liveview/realtimelog.php on line 93
[09-Jun-2009 11:00:44] PHP Warning:  file(/public_html/liveview/realtime.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 107
[09-Jun-2009 11:00:44] PHP Warning:  fopen(/public_html/liveview/realtime.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 131
[09-Jun-2009 11:01:44] PHP Warning:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/meteotor/public_html/liveview/realtimelog.php on line 93
[09-Jun-2009 11:01:44] PHP Warning:  file(/public_html/liveview/realtime.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 107
[09-Jun-2009 11:01:44] PHP Warning:  fopen(/public_html/liveview/realtime.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 131
[09-Jun-2009 11:02:35] PHP Warning:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/meteotor/public_html/liveview/realtimelog.php on line 93
[09-Jun-2009 11:02:35] PHP Warning:  file(/realtime.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 107
[09-Jun-2009 11:02:35] PHP Warning:  fopen(/realtime.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied in /home/meteotor/public_html/liveview/realtimelog.php on line 131
[09-Jun-2009 11:02:44] PHP Warning:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/meteotor/public_html/liveview/realtimelog.php on line 93
[09-Jun-2009 11:02:44] PHP Warning:  file(/realtime.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 107
[09-Jun-2009 11:02:44] PHP Warning:  fopen(/realtime.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied in /home/meteotor/public_html/liveview/realtimelog.php on line 131
[09-Jun-2009 11:03:45] PHP Warning:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/meteotor/public_html/liveview/realtimelog.php on line 93
[09-Jun-2009 11:03:45] PHP Warning:  file(/realtime.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /home/meteotor/public_html/liveview/realtimelog.php on line 107
[09-Jun-2009 11:03:45] PHP Warning:  fopen(/realtime.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied in /home/meteotor/public_html/liveview/realtimelog.php on line 131
I don't know have to do... :oops:

Re: Cumulus Server Sided JpGraph Graphs

Posted: Tue 09 Jun 2009 8:19 pm
by meteotortosa
It's working!!!

http://www.meteotortosa.cat/liveview/jp ... -graph.php

only one thing more, how can I get Uv/rad graph?

A lot of thanks

Lluís

Re: Cumulus Server Sided JpGraph Graphs

Posted: Wed 10 Jun 2009 10:08 am
by pinto
try this (attachement)
drop it in the same folder with the others

Re: Cumulus Server Sided JpGraph Graphs

Posted: Wed 10 Jun 2009 10:21 am
by meteotortosa
pinto wrote:try this (attachement)
drop it in the same folder with the others

A lot of thanks

Re: Cumulus Server Sided JpGraph Graphs

Posted: Wed 10 Jun 2009 10:31 am
by meteotortosa
:roll: :roll:
Image

Re: Cumulus Server Sided JpGraph Graphs

Posted: Wed 10 Jun 2009 1:33 pm
by pinto
sorry, it was a long time ago.

replace the array in GraphSettings.php with the folowing array

Code: Select all

// Current field names (matches tag fields) used
$SITE['cvalues'] = array(
	"date","time","temp","hum","dew","wspeed","wgust","avgbearing","rrate",
	"rfall","press","wdir","beaufort","windunit","tempunit","pressunit","rainunit",
	"windrun","presstrend","rmonth","ryear","rfallY","intemp","inhum","wchill",
	"temptrendval","tempTH","TtempTH","tempTL","TtempTL",
	"windTM","TwindTM","wgustTM","TwgustTM",
	"pressTH","TpressTH","pressTL","TpressTL",
	"version","build","rmaxgust","heatindex","humidex",
        "uv","et","solar");

Re: Cumulus Server Sided JpGraph Graphs

Posted: Wed 10 Jun 2009 9:33 pm
by meteotortosa
pinto wrote:sorry, it was a long time ago.

replace the array in GraphSettings.php with the folowing array

Code: Select all

// Current field names (matches tag fields) used
$SITE['cvalues'] = array(
	"date","time","temp","hum","dew","wspeed","wgust","avgbearing","rrate",
	"rfall","press","wdir","beaufort","windunit","tempunit","pressunit","rainunit",
	"windrun","presstrend","rmonth","ryear","rfallY","intemp","inhum","wchill",
	"temptrendval","tempTH","TtempTH","tempTL","TtempTL",
	"windTM","TwindTM","wgustTM","TwgustTM",
	"pressTH","TpressTH","pressTL","TpressTL",
	"version","build","rmaxgust","heatindex","humidex",
        "uv","et","solar");
:D :D :D :D :D
Image

A lot of thanks pinto

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 08 Jan 2010 7:37 pm
by regg001
Paul C wrote:I wonder if some of the expert can advise me regards the look of the wind graph.

Image

Can you confirm that the red line is the Gust ? and the shaded area is the average ?

I get the impression sometimes that is doesnt look right, maybe its the way its being recorded. I was thinking that the red line spikes should always be higher than the shaded area. I also had a Gust of 42.6knots at 1307hrs but this isnt recorded at all ?
any suggestions or thoughts
tks
I had the same situation here when i started to play with the code to get the graph i needed. Currently the original package is using ''wgust'' to plot the wind gust - that way you will mostly (or very often) endup with the gust being slower than the average wind. That is kind of very confusing when you look at the graph.

I decided to use the rmaxgust (recent max gust) instead of windgust and i'm getting a graph that is alot closer to reality and i'm sure i'm always picking up the strongest gust from the last 10 minutes interval (i added that functionnality for the 24hrs graphs). I'm not done yet with that graph but here's a view so far. I'm not sure how the rmaxgust is set lower (what logic or time period...), i might have to tweek it down the road, but for now it does the job.

Image

I need to translate the NWES from the compass to the right (W should be O in french), anybody know where it is in the package (jpgraph) ?

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 08 Jan 2010 7:45 pm
by steve
The VP2 doesn't actually supply a 'gust' in the sense that most people expect - a 'peak' value. It supplies a short-term wind speed over the previous three seconds, and a 10-minute average. So some of the time the 'short term' value will be below the average and some of the time above. This is why I introduced the 'recent max gust' to give the peak short-term speed in the last 10 minutes.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 08 Jan 2010 8:21 pm
by regg001
And that was a very good addition. Now that you make me think about the banner, i also changed it the same way :D .

I'm working to have all that working on my pc instead of the server - running Php on the PC side. So the only download to the server would be some png .

Any chance to have the monthly archived data with the same level of detail or format has the realtime.txt file (every 10 minutes). That would suppress the need to run the realtimelog.php and would take care of the monthly cutover as it is already implemented in the archive. At the same time, this would prevent the lost of data if cumulus is stopped or the server goes down.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 08 Jan 2010 8:30 pm
by steve
regg001 wrote:Any chance to have the monthly archived data with the same level of detail or format has the realtime.txt file (every 10 minutes).
It couldn't be the same format; firstly, I don't want to change the layout of the existing items, and secondly, some of the items in realtime.txt don't really make sense in the context of the monthly log file.

But anyway, disregarding all that, I fully accept that the current log files are rather deficient, and this is one of the things I'm addressing in Cumulus 2. I don't have any plans (at this moment) to add anything else to the C1 log files. But plans do change...

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 08 Jan 2010 8:47 pm
by regg001
regg001 wrote: I need to translate the NWES from the compass (W should be O in french), anybody know where it is in the package (jpgraph) ?
Please do not respond (or laught at me) :oops: It's right there in the GraphSettings.php . Boy sometimes we search very far for something so obvious.
:lol: