Page 3 of 4

Re: Cumulus and jpgraphs

Posted: Thu 10 Mar 2011 1:02 pm
by dvandellen
Hmm, i uploaded all the 'Cumulus PHP JpGraph Graphs'.

I dont know why some of them dont work..

Edit: I changed the rights of all jpgraph files to read and write permission, now it gives a other error:

http://www.weerstationniawier.nl/nieuwe ... n/temp.php

Re: Cumulus and jpgraphs

Posted: Thu 10 Mar 2011 1:20 pm
by dvandellen
I figured it out by myself...

In the temp.php file on line 237 and 244 is:

237: $txtaa=new Text($chrs . "Hum");
244: $txtab=new Text($chrs . "Temp");

I changed it to :

237: $txtaa=new Text("Hum");
244: $txtab=new Text("Temp");

and now it works.

very very very strange... :?

Thanks anyway

Re: Cumulus and jpgraphs

Posted: Thu 10 Mar 2011 2:17 pm
by dvandellen
I changed all .php files that wouldn't load, so those work fine now.

Only i cant change winddir.php for some reason, this one give a other error:
http://www.weerstationniawier.nl/nieuwe ... inddir.php

Maybe someone has the same file that is working, so i can copy it to my site?

Re: Cumulus and jpgraphs

Posted: Thu 10 Mar 2011 2:34 pm
by beteljuice
Part of: http://www.weerstationniawier.nl/nieuwe ... .php?debug

Notice: Undefined index: tempunit in D:\www\weerstationniawier.n\www\nieuwegrafieken\winddir.php on line 113 DEBUG> TempUnit =
Notice: Undefined index: pressunit in D:\www\weerstationniawier.n\www\nieuwegrafieken\winddir.php on line 114 DEBUG> PressUnit =
Notice: Undefined index: rainunit in D:\www\weerstationniawier.n\www\nieuwegrafieken\winddir.php on line 115 DEBUG> RainUnit =
Notice: Undefined index: windunit in D:\www\weerstationniawier.n\www\nieuwegrafieken\winddir.php on line 116 DEBUG> WindUnit =

Re: Cumulus and jpgraphs

Posted: Thu 10 Mar 2011 3:00 pm
by dvandellen
If you put some more words in your reply i would be able to change it.
Now i have to ask what needs to be changed because i still dont know what to change... I can see its something with the pressunit etc..

So what need to be changed??

Re: Cumulus and jpgraphs

Posted: Fri 11 Mar 2011 1:18 am
by beteljuice
As I said before, I'm not using the software.

I assume that the section in winddir.php which is missing the data is common accross the various graph files.

Have a look see .....

Re: Cumulus and jpgraphs

Posted: Fri 11 Mar 2011 4:37 am
by gemini06720
beteljuice wrote:As I said before, I'm not using the software.
For someone not using the scripts, you are really trying hard to solve the problems... :D
beteljuice wrote:I assume that the section in winddir.php which is missing the data is common accross the various graph files.
I have compared the 7 graphic scripts and found that some code is missing from the 'winddir.php' script... :shock:

Re: Cumulus and jpgraphs

Posted: Fri 11 Mar 2011 4:46 am
by gemini06720
OK, some code and a variable have to be added to at least the 'winddir.php' script...

The original code - lines 96 to 110:

Code: Select all

foreach($rawdata as $key) {
  if ($got < $wanted) {

    $DATA = preg_split('/ +/', $key);

    if (freq_check(substr( ret_value("time"),3,2))) {
      debug_out("Storing data");
      debug_out("Xaxis = " . timeto12(substr(ret_value("time"),0,2)));
      debug_out("Y1axis = " . ret_value("avgbearing"));
      $rx[] = timeto12(substr(ret_value("time"),0,2));
      $ry1[] = ret_value("avgbearing");
      $got++;
    }
  }
}
The new replacement code - 4 new lines added:

Code: Select all

foreach($rawdata as $key) {
  if ($got < $wanted) {

    $DATA = preg_split('/ +/', $key);

    if (freq_check(substr( ret_value("time"),3,2))) {
      debug_out("Storing data");
      debug_out("Xaxis = " . timeto12(substr(ret_value("time"),0,2)));
      debug_out("Y1axis = " . ret_value("avgbearing"));
      $rx[] = timeto12(substr(ret_value("time"),0,2));
      $ry1[] = ret_value("avgbearing");

      $SITE['tempunit'] 	= "&#xb0;" . ret_value("tempunit");
      $SITE['pressunit'] 	= ret_value("pressunit");
      $SITE['rainunit'] 	= ret_value("rainunit");
      $SITE['windunit']	= ret_value("windunit");
      $got++;
    }
  }
}
The variable '$z' must also be defined (a few lines further down) - the original code:

Code: Select all

$x = array_reverse($rx);
$y1 = array_reverse($ry1);
The modified code:

Code: Select all

$x = array_reverse($rx);
$y1 = array_reverse($ry1);
$z = "";

Re: Cumulus and jpgraphs

Posted: Fri 11 Mar 2011 11:38 am
by dvandellen
Hey

Thanks guys, it all works fine now!

:clap:

Re: Cumulus and jpgraphs

Posted: Fri 11 Mar 2011 11:46 am
by dvandellen
An other question... ;)

How can i change the time's that are in the graphs?

Like 7am needs to be 7:00 and 7pm needs to be 19:00...

What files need to be changed?


Thanks in advance again :)

Re: Cumulus and jpgraphs

Posted: Fri 11 Mar 2011 11:56 am
by beteljuice
I'm going to have a beer ....
Image

Re: Cumulus and jpgraphs

Posted: Fri 11 Mar 2011 12:36 pm
by gemini06720
dvandellen wrote:An other question... ;)
Not another question??? :mrgreen:
dvandellen wrote:How can i change the time's that are in the graphs? ... Like 7am needs to be 7:00 and 7pm needs to be 19:00...
A line of code has to be modified in all graphic producing scripts ('baro.php, 'dewpt.php', 'intemp.php', 'rain.php', 'temp.php', 'wind.php' and 'winddir.php')...
Original code:

Code: Select all

$rx[] = timeto12(substr(ret_value("time"),0,2));
Modified code:

Code: Select all

// $rx[] = timeto12(substr(ret_value("time"),0,2)); // for 12 hour display with am/pm
$rx[] = substr(ret_value("time"),0,5); // for 24 hour display
What I have done was to comment out the old line and add the new line.

Re: Cumulus and jpgraphs

Posted: Fri 11 Mar 2011 1:17 pm
by dvandellen
Yez i know my english is not perfect :D

It works, your good in this stuff man ;)

Re: Cumulus and jpgraphs

Posted: Fri 11 Mar 2011 1:55 pm
by beteljuice
Don't even think about asking ...
Image

Note to management; please remove if / when fails or annoying :D

Edit: changed for new larger graphs :?

Re: Cumulus and jpgraphs

Posted: Fri 11 Mar 2011 4:03 pm
by dvandellen
Thats a nice idee for my website...

I was thinking about how i could place my jpgraphs in different hours (24/72/94 etc...) without getting 28 thumbnails

thanks :D