Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Cumulus Server Sided JpGraph Graphs

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

pinto
Posts: 112
Joined: Sat 11 Oct 2008 3:20 pm
Weather Station: Davis Vantage Pro 2 Plus
Operating System: Debian Buster
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post 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 ' 
Jozef
Image
andro700
Posts: 81
Joined: Mon 22 Sep 2008 10:18 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Renton, Washington
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post by andro700 »

Jozef,

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

Chuck
Image
i0i
Posts: 7
Joined: Sun 28 Dec 2008 4:50 pm
Weather Station: WH-1081 (Fine Offset type)
Location: Essex, UK
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post 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;
WH 1081 Weather Station.
North Essex, UK.
Cumulus http://www.djmorgan.org.uk/weather/
TNET graphs http://www.djmorgan.org.uk/weather/graphs/graph.php
User avatar
meteotortosa
Posts: 323
Joined: Thu 04 Dec 2008 12:15 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows XP SP3
Location: Tortosa-Baix Ebre- Catalonia
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post 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:
Weather in Tortosa (NE Spain), updated every 15'
Image Image
User avatar
meteotortosa
Posts: 323
Joined: Thu 04 Dec 2008 12:15 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows XP SP3
Location: Tortosa-Baix Ebre- Catalonia
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post 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
Weather in Tortosa (NE Spain), updated every 15'
Image Image
pinto
Posts: 112
Joined: Sat 11 Oct 2008 3:20 pm
Weather Station: Davis Vantage Pro 2 Plus
Operating System: Debian Buster
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post by pinto »

try this (attachement)
drop it in the same folder with the others
You do not have the required permissions to view the files attached to this post.
Jozef
Image
User avatar
meteotortosa
Posts: 323
Joined: Thu 04 Dec 2008 12:15 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows XP SP3
Location: Tortosa-Baix Ebre- Catalonia
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post by meteotortosa »

pinto wrote:try this (attachement)
drop it in the same folder with the others

A lot of thanks
Weather in Tortosa (NE Spain), updated every 15'
Image Image
User avatar
meteotortosa
Posts: 323
Joined: Thu 04 Dec 2008 12:15 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows XP SP3
Location: Tortosa-Baix Ebre- Catalonia
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post by meteotortosa »

:roll: :roll:
Image
Weather in Tortosa (NE Spain), updated every 15'
Image Image
pinto
Posts: 112
Joined: Sat 11 Oct 2008 3:20 pm
Weather Station: Davis Vantage Pro 2 Plus
Operating System: Debian Buster
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post 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");
Jozef
Image
User avatar
meteotortosa
Posts: 323
Joined: Thu 04 Dec 2008 12:15 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows XP SP3
Location: Tortosa-Baix Ebre- Catalonia
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post 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
Weather in Tortosa (NE Spain), updated every 15'
Image Image
regg001
Posts: 16
Joined: Sun 27 Dec 2009 5:38 am
Weather Station: Vantage Pro2
Operating System: Win XP SP3
Location: Repentigny
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post 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) ?
Image
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post 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.
Steve
regg001
Posts: 16
Joined: Sun 27 Dec 2009 5:38 am
Weather Station: Vantage Pro2
Operating System: Win XP SP3
Location: Repentigny
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post 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.
Image
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post 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...
Steve
regg001
Posts: 16
Joined: Sun 27 Dec 2009 5:38 am
Weather Station: Vantage Pro2
Operating System: Win XP SP3
Location: Repentigny
Contact:

Re: Cumulus Server Sided JpGraph Graphs

Post 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:
Image
Post Reply