How to setup jpgraphs and wxgraphs

Since we have now got more solar data in the clientrawhour.txt I have created a new graph called solar_1hr.php which is the solar values for the last whole hour. You just need to install the attached file and rename it to a .php file. I have not yet added this to the package, will do this later. You do need a a fairly recent version of WD for this to work.

Stuart


solar_1hr.txt (2.53 KB)

Hi Stuart

I have installed the solar last whole hour graph and its working perfect - both in Danish and English.

Best regards,

Henrik

Hi all,

I tried to create a language selectable image. So i placed the current line into the graphsconf.php

$lang = 'en'; // default language to be used (lowercase, must correspond to available

// overrides from Settings.php if available
global $SITE;
if (isset($SITE[ā€˜langā€™])) {$lang = $SITE[ā€˜langā€™]; }
// end of overrides from Settings.php

The image changed successfully when i change the first line $line = ā€˜enā€™
But it never took the language from the language selector used in the saratoga templates.

Why is this global site setting not coming trough in the graphsconf.php
Can somebody explain this ?
Is this because its an image and not an php inclusion ??

Thanks

Maurice

The way the language works in these graphs is that it always includes the graphlang.php and you have to rename the relevant language file to graphlang.php and overwrite the default file. If you want this to work you need to re-write the language logic so that it dynamically includes the correct language file. I never wrote it to do this originally mainly because I only ever got sent one language file so I just did not think there was a need.

Stuart

Hi Stuart,

I did change the language file from graphlang.php to graphland-en.php and graphlang-nl.php for dutch.
And when i change the language behind $lang = ā€˜enā€™; to $lang = ā€˜nlā€™ it does change the language.

But i canā€™t get the language value from the setting.php to overwrite the file language.

Maurice

Ah OK, well where in the execution of the script is the settings.php script called? As you rightly say these are images and called directly from the browser when it hits the image tag so its not inline code with the call to create the HTML data. You need to add a call to settings.php somewhere probably in graphconf file, but be careful since this is not my code there is no guarantee that there will be no conflict between variables and other things in the settings.php, my code was not designed to co-exist in execution with Kenā€™s code, it may work but just be awareā€¦

Stuart

:smiley: :smiley: Yes yes itā€™s working !!! :smiley: :smiley:

Take a look http://www.weerstationloosduinen.nl/wxabout.php?lang=en

the image language is changing when another language is selected.
I Changed the default graphlang.php to graphlang-en.php and also created a dutch version graphlang-nl.php


graphsconf.txt (9.25 KB)

Just a quick question concerning the 1 hour graphs. I noticed it was the last full hour graphs. Is there a way that it could be current instead of the last full hour. I hope I make sense. By the way nice graphs Stuart, must have taken a while to get those all.

Chuck

Chuck

I donā€™t think the data is there to support a rolling 60 mins.

"Weather-Display clientrawhour.txt Description

This contains an array of 60 unit each representing the last 60 minutes of each value. It is updated at 59 minutes after the hour by WD."

This is what I got from the parser. It looks like to me it is the last hour and not the last whole hour. Somebody correct me if I am wrong. :wink:

[quote]181 Temp Last 60 for Min 01 C 18.6

It would be if it was updated each minute, but if itā€™s only updated hourly at 59 mins past the hour then it is effectively the last clock hour.

I have it updating every 5 minutes. It is under the real time tab to upload every 5 minutes.
Chuck

Oh well, then Kevinā€™s document is out of date, and Iā€™m wrong. Sorry :frowning:

If you take a look at the full set of graphs there are 60 minute graphs which are the past 60 minutes, and there are last whole hour graphs which are updated at 59 minutes past each hour. At least thatā€™s what was there when I created them. I dont believe there are any missing for which data is available, if Iā€™m wrong then let me know where the data isā€¦

Stuart

The _1hr.php graphs are based on clientrawhour.txt, so if your assumption (like mine) is that the file is only updated each hour, but Chuckā€™s is updating each 5 minutes, then maybe the graph isnā€™t working as intended. I guess we need to understand how the data fields in clientrawhour update with the frequent update?

Yes Chuck PMā€™d me. Iā€™d appreciate some confirmation from Brian as to how the clientrawhour.txt is being updated now. Originally it was once per hour at 59 minutes past each hour. Need to know if this has changed and how often its uploaded.

Stuart

Iā€™ve been grabbing Chuckā€™s clientrawhour.txt for a while, the data is definitely shuffling left, see below (time stamp at the start of the record is my capture time). If itā€™s going to do this I think it needs a time stamp added so that the data can be interpreted correctly.

yes there is an otion to have the clientrawhour.txt updated every 5 minutes, and so then its the 60 minutes prior to that every 5 minutes

The problem is that the Broadstairs wxgraphs put times on the x axis that assume that the last data element is 59 minutes past the hour. That used to be a good assumption, but now thereā€™s no knowing what the time stamps should be.

Yes its going to be a problem knowing what that timing is, it may be possible from the timestamp on the file but even then the tie wont be that accurate. I wonder how Julian works out what to use for the time axis? Right now I cant remember howq I made the timestamp. Iā€™ll have a look later today and see what I can do.

Stuart