Weather-Watch.com

Weather and the Internet => Creating Weather Web Sites => Topic started by: Tim Hanko on November 02, 2007, 03:01:36 AM

Title: How to setup jpgraphs and wxgraphs
Post by: Tim Hanko on November 02, 2007, 03:01:36 AM
I just typed up an email to someone explaining all the steps to get jpgraphs working.

If anyone is interested:

1. Copy test.php (in the attached zip) to your web server root. Browse to it. It will tell you what version of php your web server supports, if any.

2. Scroll down the resulting page and make sure GD Support is enabled.

3. Go to the JPGraph home page (http://jpgraph.net/download/) and download the version appropriate to the version of PHP on your server, ie, 1.22 for PHP4 or 2.2 for PHP5.

4. Go to Broadstairs' home page (http://www.stella-maris.org.uk/code.shtml) to download the wxgraphs.zip file.

5. Edit graphsconf.php in the wxgraphs folder:
   a. Make sure these two lines point to the correct folders:

$hostloc = "${WEBROOT}/";                   //must have trailing slash
$jploc = "${WEBROOT}/jpgraph-1.22/src/";   //must have trailing slash

   b. Make any necessary changes to reflect the units you want to use. Directions are in the graphsconf.php file.

6. Create a new folder under jpgraph-x.xx called ttf.

7. Upload hardpath.php (in the attached zip) to the jpgraph-x.xx/ttf folder on your web server and browse to it.
   a. You'll get a line that looks something like:

/homepages/24/d87962498/htdocs/jpgraph-1.22/ttf/

8. Copy this line to the clipboard.

9. Edit jpg-config.inc.php in the jpgraph-x.xx/src folder:
   a. Uncomment the line that begins with DEFINE("TTF_DIR",". (Line 40 in my editor)
   b. Replace the default path with the result of browsing to hardpath.php.

10. Upload the jpgraph-x.xx folder to your web server. You do not need to upload the jpgraph-x.xx/docs folder.

11. Upload the wxgraphs folder to your web server.

12. Upload arialbd.ttf and arial.ttf from your /windows/fonts folder to /jpgraph-x.xx/ttf folder on the web server.

13. You should now be able to insert graphs by including image links to the files in the wxgraphs folder in your web pages.

   a. <img src="wxgraphs/rain_1hr.php /"> for example

14. Delete test.php from your web server when your graphs are working.

See mine at www.thanko.info/rainfall.php (http://www.thanko.info/rainfall.php) and http://www.thanko.info/trend_graphs.php (http://www.thanko.info/trend_graphs.php).

hardpath.php is thanks to Pinto from this thread:

http://www.weather-watch.com/smf/index.php/topic,26379.0.html (http://www.weather-watch.com/smf/index.php/topic,26379.0.html)

Any comments, changes or suggestions are welcomed.
Title: Re: jpgraphs setup
Post by: broadstairs on November 02, 2007, 09:54:52 AM
Well done Tim, I was about to do something similar but you beat me to it.

Stuart

Please note the correct location for downloading the zip file is https://www.stella-maris.org.uk/code.phtml (https://www.stella-maris.org.uk/code.phtml)
Title: Re: jpgraphs setup
Post by: daveq on November 02, 2007, 12:56:12 PM
Looks like a FAQ that would be helpful.  Maybe someone could make it one.

--Dave
Title: Re: jpgraphs setup
Post by: niko on November 02, 2007, 01:45:55 PM
Looks like a FAQ that would be helpful.  Maybe someone could make it one.

--Dave

Funny you should mention that, Stuart and I had been discussing it too. The FAQ is defined as "Frequently Asked Questions about Weather Display", this very useful information doesn't fit that definition. I have made this topic a sticky at the top of this forum.
Title: Re: jpgraphs setup
Post by: niko on November 02, 2007, 01:52:45 PM
Tim

I suggest adding a line about deleting test.php after it's used, I believe it's a security risk. You could change the title to something like "How to setup jpgraph" so it's clear this is informational rather than a question.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Tim Hanko on November 02, 2007, 01:56:14 PM
Niko,

I've made the changes you suggested. Let me know if you like it better.

Whatever is appropriate, whether a faq or a sticky, is fine with me.

I'm happy to contribute something worthwhile.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Tim Hanko on November 03, 2007, 12:27:15 PM
Niko,

I just noticed that you use in your avatar one of the coolest words in the English language.  :D
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on November 03, 2007, 02:11:58 PM
Thanks for noticing  :lol:
Title: Re: How to setup jpgraphs and wxgraphs
Post by: kewee on January 04, 2008, 02:17:40 AM
Could someone tell me where the wxgraph folder is. I have downloaded jpgraph-1.22 and unzipped it but cannot find a wxgraph folder.

Thanks,

Rick #-o
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Tim Hanko on January 04, 2008, 03:04:29 AM
You need to download wxgraphs from here:

http://www.stella-maris.org.uk/code.shtml (http://www.stella-maris.org.uk/code.shtml)

Probably should add that to the directions...
Title: Re: How to setup jpgraphs and wxgraphs
Post by: kewee on January 05, 2008, 02:02:55 AM
Tim.

Thank you so much....

Rick
Title: Re: How to setup jpgraphs and wxgraphs
Post by: kewee on January 05, 2008, 02:37:14 AM
Can someone give me some help on the coding for this. I am getting the error:

Parse error: parse error, unexpected '.' in /home/content/k/4/r/k4rcb/html/weather/wxgraph/graphsconf.php on line 7

wxgraph/graphsconf.php

$hostloc = "${./WEBROOT}/";                   //must have trailing slash
$jploc = "${./WEBROOT}/jpgraph-1.22.5/src/";   //must have trailing slash

clientraw files and jpgraph-1.22/src are in the ./weather folder.

Thanks again for your help,

Rick
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Tim Hanko on January 05, 2008, 02:41:56 AM
Kewee,

Remove the . before WEBROOT in both lines.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: kewee on January 05, 2008, 03:18:31 AM
Tim,

Sorry the ./ was removed. Typo on my part.

These are the errors:

Warning: main(/home/content/k/4/r/k4rcb/html/jpgraph-1.22.5/src/jpgraph.php): failed to open stream: No such file or directory in /home/content/k/4/r/k4rcb/html/weather/wxgraph/baro_24hr.php on line 4

Warning: main(/home/content/k/4/r/k4rcb/html/jpgraph-1.22.5/src/jpgraph.php): failed to open stream: No such file or directory in /home/content/k/4/r/k4rcb/html/weather/wxgraph/baro_24hr.php on line 4

Warning: main(): Failed opening '/home/content/k/4/r/k4rcb/html/jpgraph-1.22.5/src/jpgraph.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/k/4/r/k4rcb/html/weather/wxgraph/baro_24hr.php on line 4

Warning: main(/home/content/k/4/r/k4rcb/html/jpgraph-1.22.5/src/jpgraph_line.php): failed to open stream: No such file or directory in /home/content/k/4/r/k4rcb/html/weather/wxgraph/baro_24hr.php on line 5

Warning: main(/home/content/k/4/r/k4rcb/html/jpgraph-1.22.5/src/jpgraph_line.php): failed to open stream: No such file or directory in /home/content/k/4/r/k4rcb/html/weather/wxgraph/baro_24hr.php on line 5

Warning: main(): Failed opening '/home/content/k/4/r/k4rcb/html/jpgraph-1.22.5/src/jpgraph_line.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/k/4/r/k4rcb/html/weather/wxgraph/baro_24hr.php on line 5

Fatal error: Cannot instantiate non-existent class: graph in /home/content/k/4/r/k4rcb/html/weather/wxgraph/baro_24hr.php on line 32

The page is http://www.dominion-llc.com/weather/wxgraph/baro_24hr.php

As you can see I am very much a novice at PHP.

Thanks,

Rick
Title: Re: How to setup jpgraphs and wxgraphs
Post by: dafuser on January 05, 2008, 05:04:20 AM
Kewee,

Remove the . before WEBROOT in both lines.
I'm also having a problem.  My clientraw files, jpgraph,  and wxgraphs are all located at /wx/
My config files is set as follows:

//where are your clientraw*-files and JPGraph relative to where this file is
//note you should only need to change the jpgraph directory if you do not use standard names
$hostloc = "${WEBROOT}/";                   //must have trailing slash
$jploc = "${WEBROOT}/wx/jpgraph-1.22/src/";   //must have trailing slash

If I try to load a image from the wxgraphs directory I get a page not found error. I can see the file is there when I ftp to the same directory. Any idea what I did wrong?

http://www.lesdiefenbach.org/wx/wxgraphs/rain_1hr.php


Title: Re: How to setup jpgraphs and wxgraphs
Post by: Tim Hanko on January 05, 2008, 11:59:04 AM
Kewee,

What folders did you create for jpgraph and wxgraph? Make sure the paths match exactly, including case.

dafuser,

Are all your weather files in /wx? I think you need to change $hosloc to reflect that.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: kewee on January 05, 2008, 04:35:18 PM
Wxgraph and jpgraphs folders are setup under /weather and are named wxgraph and jpgraphs-1.22. All others files are in the /weather folder.
 too.

Thanks for your help.

Rick
Title: Re: How to setup jpgraphs and wxgraphs
Post by: dafuser on January 05, 2008, 05:03:49 PM
Kewee,

What folders did you create for jpgraph and wxgraph? Make sure the paths match exactly, including case.

dafuser,

Are all your weather files in /wx? I think you need to change $hosloc to reflect that.
Yes, all files are under /wx/  I changed the WEBROOT to poit to /wx/ but still get the files not found error when I try to access any of the image files in the wxgraph folder
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Tim Hanko on January 05, 2008, 06:14:07 PM
Could you both post the results of running hardpath.php?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: dafuser on January 05, 2008, 07:09:46 PM
Could you both post the results of running hardpath.php?

My hardpath.php is located at:

http://www.lesdiefenbach.org/wx/jpgraph-1.22/ttf/hardpath.php

The results I get when running it are:

/home/content/d/a/f/dafuser/html/wx/jpgraph-1.22/ttf/


Title: Re: How to setup jpgraphs and wxgraphs
Post by: Tim Hanko on January 05, 2008, 07:14:43 PM
dafuser,

Use the rain_1hr.php in an image tag, like in the directions above.

<img src="wx/wxgraphs/rain_1hr.php" />

And if you are getting a file not found error (I am too) then make sure the file is there. If it is there it may not work but you should not get a file not found error.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: kewee on January 05, 2008, 08:57:30 PM
Here is my results:

/home/content/k/4/r/k4rcb/html/weather/jpgraphs-1.22/ttf/

Rick
Title: Re: How to setup jpgraphs and wxgraphs
Post by: dafuser on January 05, 2008, 09:32:57 PM
dafuser,

Use the rain_1hr.php in an image tag, like in the directions above.

<img src="wx/wxgraphs/rain_1hr.php" />

And if you are getting a file not found error (I am too) then make sure the file is there. If it is there it may not work but you should not get a file not found error.
I deleted the wxgraphs and jpgraph-1.22 directories. I downloaded fresh copies and uploaded them to my web site. I put test.php and hardpath.php in wxgraphs and jpgraphs/ttf/

http://www.lesdiefenbach.org/wx/wxgraphs/test.php - This works fine
http://www.lesdiefenbach.org/wx/wxgraphs/hardpath.php - This works fine

http://www.lesdiefenbach.org/wx/jpgraph-1.22/ttf/test.php - This works fine
http://www.lesdiefenbach.org/wx/jpgraph-1.22/ttf/hardpath.php - This works fine

Both jpgraph-1.22 and wxgraphs can be accessed by my browsers

All my weather files are located in /wx

My graphsconf.php in the wxgraphs folder looks like this:

//where are your clientraw*-files and JPGraph relative to where this file is
//note you should only need to change the jpgraph directory if you do not use standard names
$hostloc = "${/wx}/";                   //must have trailing slash
$jploc = "${WEBROOT}/jpgraph-1.22/src/";   //must have trailing slash

My jpg-config.inc.php in the jpgraph-x.xx/src folder looks like this

// TTF_DIR:
// Directory where TTF fonts can be found. Must end with '/'
//
// The default values used if these defines are left commented out are:
//
// UNIX:
//   CACHE_DIR /tmp/jpgraph_cache/
TTF_DIR   /home/content/d/a/f/dafuser/html/wx/jpgraph-1.22/ttf/
//   MBTTF_DIR /usr/share/fonts/ja/TrueType/
//
// WINDOWS:
//   CACHE_DIR $SERVER_TEMP/jpgraph_cache/
//   TTF_DIR   $SERVER_SYSTEMROOT/fonts/
//   MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
//
//------------------------------------------------------------------------
// DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");
DEFINE("TTF_DIR","/home/content/d/a/f/dafuser/html/wx/jpgraph-1.22/ttf/");
// DEFINE("MBTTF_DIR","/usr/share/fonts/ja/TrueType/");

//-------------------------------------------------------------------------

I have the aerial font files loaded in /wx/jpgraph-1.22/ttf

I'm calling the images using www.lesdiefenbach.org/wx/imagetest.php using:

<table class="weather">
   <tr>
      <td class="data"><img src="wxgraphs/month_hilo_temp.php" /></td>
      <td class="data"><img src="wxgraphs/month_baro.php" /></td>
   </tr>
   <tr>
      <td class="data"><img src="wxgraphs/month_winddir.php" /></td>
      <td class="data"><img src="wxgraphs/month_windspeed.php" /></td>
   </tr>
   <tr>
      <td class="data"><img src="wxgraphs/month_rain.php" /></td>
      <td class="data"><img src="wxgraphs/month_humidity.php" /></td>

I don't see anything but broken images. When I try to view the individual images at:

http://www.lesdiefenbach.org/wx/wxgraphs/month_baro.php

I get this error:

Parse error: parse error, unexpected '/' in /home/content/d/a/f/dafuser/html/wx/wxgraphs/graphsconf.php on line 7

Trying http://www.lesdiefenbach.org/wx/wxgraphs/month_rain.php gets the same error:

Parse error: parse error, unexpected '/' in /home/content/d/a/f/dafuser/html/wx/wxgraphs/graphsconf.php on line 7

Looks like it can't find the clientraw files for some reason. Line 7 in my files shows it's looking for the clientraw files:

//$clientraw = get_raw("${hostloc}clientraw.txt");
//$clientrawextra = get_raw("${hostloc}clientrawextra.txt");
$clientrawdaily = get_raw ("${hostloc}clientrawdaily.txt");

The client raw files are in my /wx directory

http://www.lesdiefenbach.org/wx/clientraw.txt

12345 5.8 4.7 16 26.4 31 983.0 0.0 0.0 0.0 0.000 0.000 24.8 25 0.0 4 0.0 0 0 0.0 0.0 0.0 0.0 -100.0 -100.0 -100.0 0 0 0 14 42 47 Weather_from_the_shores_of_Lake_Granbury-2:42:47_PM 0 0 5 1 100 100 100 100 100 100 100 26.4 26.8 26.7 10.9 5 Dry -1.0 7 7 7 8 8 8 8 8 8 8 8 8 8 8 5 5 5 5 5 5 12.2 7.9 8314.5 1/5/2008 27.2 11.9 26.7 10.9 0.0 7 6 6 7 7 6 5 4 6 5 25.7 25.9 26.2 26.2 26.2 26.2 26.5 26.6 26.6 26.5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 26.3 10.9 26.1 9.5 0 --- --- 38 0 0 -100.0 -100.0 -100 0 0 0 0 0.0 25.0 22.3 24.9 990.0 983.0 11 14:07 12:47 25.9 11.0 13.6 7.3 7 2008 0.0 1 -1 1 47 32 65 48 23 36 14 44 45 33 0.0 0.0 5.4 !!C10.37g!!

Does this help troubleshooting? It's probably something minor I have messed up.





Title: Re: How to setup jpgraphs and wxgraphs
Post by: Tim Hanko on January 05, 2008, 09:41:52 PM
Here are the two variables I use:

$hostloc = "${WEBROOT}/";                   //must have trailing slash
$jploc = "${WEBROOT}/jpgraph-1.22/src/";   //must have trailing slash

dafuser,

I think yours should read:

$hostloc = "${WEBROOT}/wx/";                   //must have trailing slash
$jploc = "${WEBROOT}/wx/jpgraph-1.22/src/";   //must have trailing slash
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jacg on January 05, 2008, 09:50:30 PM
Maybe a hint for people who have a webhost in safemode (just like me)
Only use abolute paths, like the hardpath one.

So in graphsconf.php the lines to your jpgraph and clientraw dir, remove the webhost part ( ${WEBROOT}/ ) and just write out the full path.
That does the job!


Title: Re: How to setup jpgraphs and wxgraphs
Post by: dafuser on January 05, 2008, 10:02:26 PM
Maybe a hint for people who have a webhost in safemode (just like me)
Only use abolute paths, like the hardpath one.

So in graphsconf.php the lines to your jpgraph and clientraw dir, remove the webhost part ( ${WEBROOT}/ ) and just write out the full path.
That does the job!

I gave that a try but still get the same error where it looks like it can't find the clientraw files. They are in the /wx directory.

<?php
// Obtain Basic Environment
$WEBROOT        = $_SERVER['DOCUMENT_ROOT'];
//==========================================
//where are your clientraw*-files and JPGraph relative to where this file is
//note you should only need to change the jpgraph directory if you do not use standard names
$hostloc = /home/content/d/a/f/dafuser/html/wx/;                    //must have trailing slash
$jploc = "/home/content/d/a/f/dafuser/html/wx/jpgraph-1.22/src/";   //must have trailing slash

Title: Re: How to setup jpgraphs and wxgraphs
Post by: dafuser on January 06, 2008, 03:38:39 AM
Here are the two variables I use:

$hostloc = "${WEBROOT}/";                   //must have trailing slash
$jploc = "${WEBROOT}/jpgraph-1.22/src/";   //must have trailing slash

dafuser,

I think yours should read:

$hostloc = "${WEBROOT}/wx/";                   //must have trailing slash
$jploc = "${WEBROOT}/wx/jpgraph-1.22/src/";   //must have trailing slash
I  fixed the problem and have the graphs working here http://www.lesdiefenbach.org/wx/graphs.php (http://www.lesdiefenbach.org/wx/imagetest.php)

It' saying

"You have specified a min value with SetAutoMin() which is larger than the maximum value ussed for the scale. This is not possible."

I think the error is coming from the month_baro.php.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: kewee on January 06, 2008, 03:45:23 AM
I  fixed the problem and have the graphs working here http://www.lesdiefenbach.org/wx/imagetest.php (http://www.lesdiefenbach.org/wx/imagetest.php)

It' saying

"You have specified a min value with SetAutoMin() which is larger than the maximum value ussed for the scale. This is not possible."

I think the error is coming from the month_baro.php.


Could you tell us what you found and how you fixed yours so we can fix ours?

Thanks,

Rick
Title: Re: How to setup jpgraphs and wxgraphs
Post by: dafuser on January 06, 2008, 03:52:34 AM

Could you tell us what you found and how you fixed yours so we can fix ours?

Thanks,

Rick
In the jpg-config.inc.php I did not the WEBROOT variable as suggested above in this thread.

//   CACHE_DIR /tmp/jpgraph_cache/
//   TTF_DIR /home/content/d/a/f/dafuser/html/wx/jpgraph-1.22/ttf/
//   MBTTF_DIR /usr/share/fonts/ja/TrueType/
//
// WINDOWS:
//   CACHE_DIR $SERVER_TEMP/jpgraph_cache/
//   TTF_DIR   $SERVER_SYSTEMROOT/fonts/
//   MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
//
//------------------------------------------------------------------------
// DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");
DEFINE("TTF_DIR","/home/content/d/a/f/dafuser/html/wx/jpgraph-1.22/ttf/");
// DEFINE("MBTTF_DIR","/usr/share/fonts/ja/TrueType/");

//-------------------------------------------------------------------------

I also had a space or two in the line  DEFINE("TTF_DIR","/home/content/d/a/f/dafuser/html/wx/jpgraph-1.22/ttf/");

After I removed the spaces and started using the path information supplied by the hardpath.php in place of the WEBROOT variable it started working.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: kewee on January 06, 2008, 03:59:39 AM
I will give that a try. Thanks for sharing.

Rick
Title: Windows path issues?
Post by: Dave.B on February 03, 2008, 01:24:07 PM
I have a question, and a bit of advice:

Advice first: I (evidently) have a windows server, and if I call my fonts folder ttf as instructed here, something in the code interprets the "\t" as a tab which results in the path to the font folder becoming corrupt. I renamed ttf to fonts and lots of stuff immediately started to work...

Now the question: Not everything works:
http://www.kingsteignton-weather.co.uk/WXGraphs/wxgraphs_test.html
http://www.kingsteignton-weather.co.uk/jpgraph-1.22/src/Examples/testsuit.php

The error message is truncated so I can't see exactly what's going on:
http://www.kingsteignton-weather.co.uk/jpgraph-1.22/src/Examples/bargradex1.php
but there still appears to be something wrong with the fonts.
Does anyone know what I have done wrong?

These are the relevant lines from jpg-config.inc.php:
//------------------------------------------------------------------------
// DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");
DEFINE("TTF_DIR","e:\domains\k\kingsteignton-weather.co.uk\user\htdocs\jpgraph-1.22\fonts/");
// DEFINE("MBTTF_DIR","/usr/share/fonts/ja/TrueType/");

//-------------------------------------------------------------------------

I'll admit that the Windows path with the wrong slashes looks really dicey - I see everyone else here has Linux servers...
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Tim Hanko on February 03, 2008, 01:28:50 PM
I'm not sure but I don't think the fonts folders should reference a drive letter.

Title: Re: How to setup jpgraphs and wxgraphs
Post by: Dave.B on February 03, 2008, 01:34:51 PM
http://www.kingsteignton-weather.co.uk/jpgraph-1.22/fonts/hardpath.php
I've no idea how to supply the path on a windows server then...
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 03, 2008, 02:58:43 PM
I've just checked my files (I run Apache on Windows here as a test server) and my paths are defined with forward slashes '/' not the usual backslash and it works, and yes it should reference the drive letter on Windows.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Dave.B on February 03, 2008, 04:55:33 PM
Stuart,
Thanks for checking. I've replaced the "\"s with "/"s but unfortunately that made no difference.
It's really weird that most of the graphs seem to work, but a few don't.
I can't think what I've done wrong. If I try to directly access one of the php files that don't work (in IE6) I get:

Notice: Undefined variable: datat in e:\domains\k\kingsteignton-weather.co.uk\user\htdocs\WXGraphs\winddir_1hr.php on line 81
JpGraph Error: HTTP headers have already been sent.
Caused by output from file winddir_1hr.php at line 81.
Explanation:
HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it's image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).
Most likely you have some text in your script before the call to Graph::Stroke(). If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser.

For example it is a common mistake to leave a blank line before the opening "<?php".


I don't know what that means, but I haven't fiddled with any of the files.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 03, 2008, 05:38:22 PM
At a guess it looks like you dont have jpgraph_scatter.php installed with the other jpgraph stuff as at least a couple of the graphs failing use a scatter plot and need this file. It should be in the JPGraphs package.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Dave.B on February 03, 2008, 06:22:15 PM
Nope... I just checked and everything in the downloaded tar file is also there on the server.
It's probably something really dumb that I've done, or not done, but I'm struggling to figure it out...
Title: Re: How to setup jpgraphs and wxgraphs
Post by: stumpey on February 03, 2008, 07:51:49 PM
Hi

I am trying to set this up but get an error I have GD and this has been confirmed by the test.php, The gd version is the php supplied version and not the standalone.

This is a linux server running php 5.2



Any help much appreciated  :D

Steve
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 03, 2008, 08:59:02 PM
Hi

I am trying to set this up but get an error I have GD and this has been confirmed by the test.php, The gd version is the php supplied version and not the standalone.

This is a linux server running php 5.2

(http://78.156.71.26/wxgraphs/rain_1hr.php)

Any help much appreciated  :D

Steve


There's an option for that, right now I cannot remember where.... Oh yes its in the graphconf.php which should be set to false. If that is set correctly then you may need to edit the individual graph files to turn it off.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: stumpey on February 04, 2008, 05:15:50 PM
I have turned off the antialias everywhere I could see it but still not much luck  :(

Some graphs work and some don't http://www.stumpey.co.uk/wxgraphs/wxgraphs_test.html which is a bit strange

So still scratching my head  #-o

Steve
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Dave.B on February 04, 2008, 05:33:04 PM
Your 12 month rain graph works - what is it that's different about that graph (and one or two others) that makes it not work on my site?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 04, 2008, 06:15:22 PM
In each graph file there should be a statement saying

$graph->img->SetAntiAliasing("$antialias");

and in graphconf.php its should say 

$antialias = "false";

Stuart

Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 04, 2008, 06:33:17 PM
I think I may have spotted something here. The message says the function ImageAntiAlias() is not supported in your GD version so I think you will have to comment it out in each of the graph files where it says $graph->img->SetAntiAliasing("$antialias"); just comment that line out and try again. I'm not sure but its worth a try.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: stumpey on February 04, 2008, 07:55:13 PM
Wooo

Thanks Stuart works like a charm  :D :D :D

Steve
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 06, 2008, 09:06:50 AM
There have been a few problems recently with the graphs I created and when I fixed them I added some new graphs which I had been working on but forgot about and these had bugs as well  :oops: :oops: :oops: #-o #-o #-o

Anyway I have reworked the graph files removing the antialias which seemed to have caused problems for at least one person (its not recommended anyway), and fixed a few others. The new graphs now work and some have also been renamed to make it a bit more logical as to what each one does. There are some new 'Last Whole Hour' graphs now built from the clientrawhour file, as well as the original last rolling 60 minutes graphs from the clientraw file. Please review the package and make sure you pick the correct files for inclusion in your websites and modify your HTML as appropriate.

Anyway your can download the zip file here (http://www.stella-maris.org.uk/code/wxgraphs.zip) and the test HTML file can be viewed  here (http://www.stella-maris.org.uk/graphs/wxgraphs_test.html) on my website.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: stumpey on February 06, 2008, 04:34:59 PM
Hi Stuart

Could we have temp+hum_24hr.php as it is missing from the new zip  :D

Regards
Steve

Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 06, 2008, 05:16:58 PM
Try again, I've just updated it. It gets quite confusing renaming and rewriting all the graphs  #-o

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Dave.B on February 06, 2008, 05:21:03 PM
Thanks Stuart - everything is working perfectly for me now.
I appreciate your help with this.
Cheers
Dave
Title: Re: How to setup jpgraphs and wxgraphs
Post by: stumpey on February 06, 2008, 06:50:39 PM
Thanks Stuart  :D
Title: Re: How to setup jpgraphs and wxgraphs
Post by: stumpey on February 10, 2008, 08:22:43 AM
Hi Suart

A small problem with the temp+hum_24hr graph when the temps go below 0 they drop off the bottom of the graph!! so it does not scale the - temps got -2 this morning..

Edit: Ok resolved the problem just disabled //$graph->yaxis->scale->SetAutoMin(0); in the //y-axis

Regards
Steve
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 10, 2008, 08:34:38 AM
Hi Suart

A small problem with the temp+hum_24hr graph when the temps go below 0 they drop off the bottom of the graph!! so it does not scale the - temps got -2 this morning..

Regards
Steve


The problem with this is that if I remove the set scale on the temp part of the graph it will set the temp minimum just below the lowest temp displayed, so with a min of 6 degrees the bottom of the temp graph is 6 not 0. However as you have found when temps go negative it does not work. So it will take a little while for me to sort out the code needed to calculate the minimum scale needed.

I also have some more graphs to add to the package so that it will then graph everything available in the clientraw set of files. Expect an update in a day or so.

Stuart

Edit: Some of the other temp graphs also need changing to accomodate negative values as well, although I think the 31 day temp graph should work OK.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: stumpey on February 10, 2008, 09:08:49 AM
Thanks Stuart

As above in my post i did a quick fix :: resolved the problem just disabled //$graph->yaxis->scale->SetAutoMin(0); in the //y-axis

Steve
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 10, 2008, 06:30:19 PM
OK I have just uploaded the package again with some extra graphs as well and I've also fixed up all the temp graphs so that if you have a negative temp it will graph OK, but if there are no minus values you still get full scale from zero which I feel looks better especially where you have two traces on the graph like temp/hum. I've removed the shading on the max/min graph as well since it does not work well with negative temps. If I can work out how to do it differently I might put it back in at a later stage.

Anyway let me know if there are any problems with these files.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: stumpey on February 10, 2008, 07:23:55 PM
Hi Suart

I get errors on the month_hilo_temp so have had to disable these as it errors on line 27 and 47

//Check for negative values in array and do a SetAuotMin(0) if none

//array_walk($datax, "NegVal");

//if ($negvalue == 0) $automin = '$graph->yaxis->scale->SetAutoMin(0);';

//else $automin = '';

//Check for negative values in array and do a SetAuotMin(0) if none

//array_walk($datalow, "NegVal");

//if ($negvalue == 0) $automin = '$graph->yaxis->scale->SetAutoMin(0);';

//else $automin = '';

Otherwise looks better as a line

regards
Steve
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 10, 2008, 08:24:05 PM
 You should replace all the graphs you are using with the new versions and the new graphsconf file before testing the graphs. The updated graphsconf.php contains the new function.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: stumpey on February 10, 2008, 09:36:31 PM
That sorted it.. :D

Steve
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Boce on February 11, 2008, 06:40:46 AM
Hi all
I set graphs and most of them are OK
But I have few JpGraphs Error
"You have specified a min value with SetAutoMIn() which is larger then the maximum value used for the scale. This is not possible"

This is my test page http://www.knjazevac.co.yu/wxgraphs/wxgraphs_test.html (http://www.knjazevac.co.yu/wxgraphs/wxgraphs_test.html)
My units for temperature is C and actual temperatura by night is below 0C
Thanx

Dejan
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 11, 2008, 08:02:30 AM
Hi all
I set graphs and most of them are OK
But I have few JpGraphs Error
"You have specified a min value with SetAutoMIn() which is larger then the maximum value used for the scale. This is not possible"

This is my test page http://www.knjazevac.co.yu/wxgraphs/wxgraphs_test.html (http://www.knjazevac.co.yu/wxgraphs/wxgraphs_test.html)
My units for temperature is C and actual temperatura by night is below 0C
Thanx

Dejan

Please download the latest zip file from my website and install that, it fixes most of the issues you have here and contains more graphs to select from. Let me know if you still have problems with this latest set.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Boce on February 11, 2008, 10:07:01 AM
Stuart, give me a link for download.

Thanx
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 11, 2008, 10:27:10 AM
Stuart, give me a link for download.

Thanx

Please take a look at this (http://www.weather-watch.com/smf/index.php/topic,27489.msg236029.html#msg236029) update in this thread.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Boce on February 11, 2008, 12:45:23 PM
Thanx Stuart
I think that is OK
We will be sure by night when Temp will be below zero

Dejan
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 11, 2008, 10:33:34 PM
I seem to be having a really simplistic problem but I can't solve it.  The two fonts are present in the jpgraph folder in a folder of their own named "ttf" but for some reason I'm getting this error.  All help appreciated.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 11, 2008, 10:51:56 PM
You can't just upload fonts, you have to install them, see this Broadstairs post (http://www.weather-watch.com/smf/index.php/topic,22874.msg179507.html#msg179507) for instructions.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 12, 2008, 12:07:38 AM
Thanks, Niko.....I had done the "hard path" but neglected to put the rest of it in. 
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 15, 2008, 12:56:18 AM
On the different graphs that are labelled "last whole hour" I have a question.  My local time is 18:53.  On each of the different types of graphs that I have running so far the ones that are for the time period  "last whole hour" are showing 16:xx.  Why would they not show 17:xx?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 15, 2008, 01:03:17 AM
Do you have a link to the graph?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 15, 2008, 03:25:22 AM
http://www.luvretirement.com/graphtemp.php  My time now is 9:30PM.  The graph shows that the "last whole hour" was 7:00 PM to 7:59 PM.  I'm not questioning the operation of the script at all, I'm just curious about the terminology.

Also another time question:  The "last whole hour" time is in 12hr format; the "last 60 minutes" time is in 24hr format; the "indoor temperature" time is in 12hr format but doesn't specify AM or PM.  Just curious.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 15, 2008, 04:04:04 AM
It appears to calculate the times for the last hour from the filedate/time that it sees on clientrawhour.txt file (not in the file, the actual file creation/update date/time) on the server. So if you look at that file with your ftp client, what time does it show? And is that GMT/UTC or somehow related to your local clock time?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 15, 2008, 08:05:09 AM
The time is calculated from the file modified time because, at least on my server, it is not created each time but modified. The clientrawhour.txt is the file and it is created at 59 minutes past each hour and the data contained in it represents the data for the hour which is just about to end, and in my testing I found that mine was always uploaded on the hour or just after the hour so I take the time and reduce the hour value by one. Now it is just possible that your weather PC creates this file say at 16:59:00 and uploads it so the time stamp is 16:59:59 in which case my calculation will fail because it should be the hour ending at 16:59:59 but the graph will display hour 15. The problem here is that this data file does not have a timestamp so I have to calculate the time represented somehow. WDL gets round it be only showing the minutes as a negative value. I decided on this way to make it the same as the other graphs and I think the data may well be uploaded more than once per hour as well in which case the second time it uploads the time will display correctly.

If someone can suggest a more reliable way then I can change it, or maybe we could ask Brian to add the timestamp to the file showing when the data is created which would be the best way to do it.

Stuart

EDIT: I do think in retrospect we need a time stamp in the file because if your server is in a different timezone it will also show wrong since I'm using the server file time. Yes I know I could get PHP to work with the correct timezone but I think the best way is to ask Brian to add the time stamp.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 15, 2008, 02:56:37 PM
EDIT: I do think in retrospect we need a time stamp in the file because if your server is in a different timezone it will also show wrong since I'm using the server file time. Yes I know I could get PHP to work with the correct timezone but I think the best way is to ask Brian to add the time stamp.

I think the way you are doing it is fine. If you just add a user entered (at install) variable in the code for an offset between server time and station time it should be almost bulletproof.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 15, 2008, 03:01:39 PM
GoDaddy offices are located in Scottsdale, AZ but how would you find out where their server farm is?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 15, 2008, 03:08:13 PM
Setting a timezone on PHP requires PHP V5.1.0 as a minimum which would mean that these graphs would require that level of PHP.

To answer the other point it would be your station timezone which would be used and therefore it would not matter where the server was located or what timezone it worked on.

I guess the other point would be daylight saving as well.

I still think it would be best to ask Brian to add a field which represented perhaps just the hour value that the data represented. That would work universally and not require PHP V5.1.0 either.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 15, 2008, 03:44:35 PM
It certainly would be easier if there was a timestamp. I'm not sure how lulu's graph is working at all, her server responds that it's set to GMT so I would have thought that's what the file time would be in.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 15, 2008, 03:51:26 PM
It certainly would be easier if there was a timestamp. I'm not sure how lulu's graph is working at all, her server responds that it's set to GMT so I would have thought that's what the file time would be in.

One of the questions during domain set up pertains to what time zone you are in if that makes any difference. :dontknow:
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 15, 2008, 04:26:01 PM
As to servers I guess it may well be possible for them to be set to the users timezone, perhaps someone who knows could confirm this.

As to the mixed time styles 12 vs 24 hour format. All my graphs show in 24 hour format, but I run WD in 24hr mode. Any graphs which have time values (the 24 hour ones all have time stamps in the appropriate clientraw file) will show in whatever mode you run WD in, all the others are coded in 24 hour mode which was the way I coded it.

I probably think right now that the graphs need some cleaning up and sorting out a bit to perhaps externalise some more stuff to the config file. As to the timing of the last whole hour graphs I still would like Brian to consider adding a time stap of the hour the data represents which makes that part fireproof. The other time formats could then be externalised to the config file.

Right now I probably dont have the time to do this, I will consider it but it will be a while before it happens.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 18, 2008, 06:12:47 PM
I have been looking again at the graphs and thanks to Jim (aka jmcmurray) I now have two more graphs to add which contain a calculated dew point, they are last whole hour and 24 hour temperature+dewpoint+humidity graphs. I have also, again thats to Jim's file, got a better way to find the hour being processed for the clientrawhour (last whole hour) graphs which does not rely on finding file modified times and does not worry about timezones etc. So the graphs will continue to work with both PHP4 and PHP5, at least for now. I will no longer test any graphs on PHP4 after the next update which will probably be out in the next week or so.

I would recommend people going to PHP5 if at all possible because PHP4 will no longer be enhanced after 31 Dec 2007 and no longer get critical security fixes after 08 August 2008. See www.php.net (http://www.php.net/)

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 18, 2008, 07:16:02 PM
If the domain provider is not planning on using PHP5 I don't think there's any way an individual can make that happen is there?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 18, 2008, 11:06:40 PM
If the domain provider is not planning on using PHP5 I don't think there's any way an individual can make that happen is there?

I really cannot see any hosting provider worth being with not being able to at least install PHP5 along side PHP4 so folks can migrate by August this year, they have to understand that after August this year there will be no security holes patched in PHP4 and therefore leave themselves open to any problem. This is not new news, its was announced on 13th July 2007.

If my provider had not indicated that PHP5 was to be made available I'd email them demanding it. There is probably very little PHP4 code out there today which will not run under V5. I should point out that my provider has both available and the user can switch it over themselves.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 18, 2008, 11:23:46 PM
Interesting............I sent GoDaddy an email earlier today asking them about this...........I should hear back soon.  Anyway, if they should upgrade to PHP 5 can they also maintain PHP4 if they want to and/or how would a person with a websitesite indicate to them that the website was using code for 5 and not 4?  I am not knowlegable about these things and am really interested in knowing.  It's a curiousity thing :oops:
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 18, 2008, 11:54:39 PM
Anyway, if they should upgrade to PHP 5 can they also maintain PHP4 if they want to and/or how would a person with a website indicate to them that the website was using code for 5 and not 4? 

It depends on how they install it but yes they can have and support both. My provider allows you to specify via an entry in the .htaccess file if you want PHP5, currently PHP4 is the default. It could also be done by them when you sign up or request either 4 or 5 to be your default at a later stage. In fact my provider will switch it for people who dont feel confident in doing it themselves.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 19, 2008, 12:47:54 AM
Interesting............I sent GoDaddy an email earlier today asking them about this...........I should hear back soon.  Anyway, if they should upgrade to PHP 5 can they also maintain PHP4 if they want to and/or how would a person with a websitesite indicate to them that the website was using code for 5 and not 4?  I am not knowlegable about these things and am really interested in knowing.  It's a curiousity thing :oops:

From the godaddy hosting features table, looks like you can have 4 or 5 (but how that's determined is a good question):

Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 19, 2008, 03:54:31 AM
From GoDaddy:

"Support Staff Response
Dear Linda McElwee,
Thank you for contacting online support.

At this time you can upgrade to php5 through your Hosting Control Center or through your php.ini file"
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 19, 2008, 04:15:14 AM
Looking at the FAQ it appears you may be able to run things under php5 by changing the suffix to that, so you could try test.php renamed test.php5 and see what it returns. If that works then it would be a way to test your scripts under 5 without switching over.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 19, 2008, 12:24:05 PM
I had realised that I need to change the code which works out the times on the graphs so that it displays correctly when running WD in both 12 and 24 hour modes. In order to test this could someone who runs WD in 12 hour (ie AM/PM) mode please let me know (either here or in a PM) the whereabouts (URL) of their clientraw files that I might use for testing?

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 19, 2008, 02:04:54 PM
PM sent
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 19, 2008, 02:15:14 PM
Thanks to both Jim and Linda for the PM's, I can now test this....

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 19, 2008, 02:22:44 PM
Looking at the FAQ it appears you may be able to run things under php5 by changing the suffix to that, so you could try test.php renamed test.php5 and see what it returns. If that works then it would be a way to test your scripts under 5 without switching over.

That seems to work.  There's gonna be a whole lot of file renaming going on I betcha.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 19, 2008, 02:26:14 PM
That seems to work.  There's gonna be a whole lot of file renaming going on I betcha.

That a good way to test compatibility with php 5, but once you switch to 5 using your hosting control or php.ini file then .php scripts will run under 5, you won't need to change the names.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 19, 2008, 03:50:20 PM
OK..........even better :D

On further investigation GoDaddy can handle both at the same time.  If you want to use mixed extensions "php and php5" then all you hve to do is use php5 for those files and just plain php for php4 files.
Title: temp_7days.php file
Post by: rford on February 19, 2008, 07:27:45 PM
I have just completed updating my graph page to reflect the 7 day graphs.  I have been unable to get the temp_7days.php graph to work on my site...all others are fine. 

http://www.i40exit319weather.com/wx11.html (http://www.i40exit319weather.com/wx11.html)

Could someone provide me with some areas to check...at this point I can't see the forest for the trees.

Thanks,
Ronnie
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SandhurstWX on February 19, 2008, 07:47:01 PM
Ronnie,

If I just run the temp_7days.php graph on its own, by putting http://www.i40exit319weather.com/graphs/temp_7days.php into the address bar, i get the following error:

Quote
Warning: array_walk(): Unable to call NegVal() - function does not exist in /home/content/....../html/graphs/temp_7days.php on line 22

(I've removed part of the path for your security). So i expect there is an error around line 22 of the code, I had something similar but off the top of my head I can't remember. I'll haved a look & try to remember to get back.

Ian

Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 19, 2008, 07:49:10 PM
Ronnie you have not installed the latest version of the graphsconf.php file. When updating the graphs you must install the latest graphsconf.php as well.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SandhurstWX on February 19, 2008, 08:21:05 PM
Ronnie you have not installed the latest version of the graphsconf.php file. When updating the graphs you must install the latest graphsconf.php as well.

Stuart

That was it! I had that problem also  #-o so that's your answer.

I see you have it working now  :D
Title: Re: How to setup jpgraphs and wxgraphs
Post by: rford on February 19, 2008, 09:03:23 PM
Thanks for the assistance everyone...working fine....

Ronnie
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 24, 2008, 05:26:28 PM
I have now got my latest set of graphs ready for public viewing. I have setup three sets to look at

1. First set (http://www.stella-maris.org.uk/graphs1/wxgraphs_test.html) using metric + MPH and my own data

2. Second set (http://www.stella-maris.org.uk/graphs2/wxgraphs_test.html) using US measurements and a US website's data

3. Third set (http://www.stella-maris.org.uk/graphs3/wxgraphs_test.html) using US measurements and another US website's data

These graphs have more user customisable information, you can choose the plot line colours as well as all the units. They will attempt to handle negative values correctly in all temperature related graphs and should set the y-axis scale accordingly. These graphs are currently running on PHP4 and JPGraph 1.20.5, they have also been tested OK on PHP v5 and JPGraph 2.3.

Please let me know what you think. If all looks OK then I'll plan to get a package ready for downloading in a day or so.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 24, 2008, 06:12:08 PM
Wow, I know how much work it is to put together a set like that. A couple of comments based on the first graph of the first US set. Mixed resolution of the displayed values causes confusion. The vertical scale, 0, 0.01, 0.01, 0.02, 0.02 appears confusing because the legend resolution doesn't match the scale increments, and then the single dp value on top of the column is 0.0, apparently not matching the graph.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 24, 2008, 11:42:13 PM
Niko I missed that. The problem is with rain in inches and the number of ticks on the y-axis. Apparent;y its possible to get values like 0.252in of rain, now I mistakenly assumed that since most if not all rain guages had a resolution of 0.01in like my Davis I would always see values of multiples of 0.01in - not true. The issue with the y-axis labels can be sorted by having only very other one, but usually when there is more than a small amount of rain you need each tick labelled. This needs some more thinking about and maybe some more php code in the graphs themselves. The amount labels on the column tops were missing because I'd left out a line in some of the graphs - oops.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 24, 2008, 11:45:35 PM
I think you see those extra dp's because the inch data is stored in mm by WD and that introduces some small errors when converted back to inches for display.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 24, 2008, 11:55:32 PM
I think you see those extra dp's because the inch data is stored in mm by WD and that introduces some small errors when converted back to inches for display.

Yes you are correct, I'd just looked at the code. I round the result to 2 decimal places at least that's what is coded but its not working as I expected.... Need to get some ZZZZZZ's now I'll look again in the morning.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 25, 2008, 06:05:20 PM
Right guys time to try again. Fixed the problems noted by Niko and another couple I noticed myself.

1. First set (http://www.stella-maris.org.uk/graphs1/wxgraphs_test.html) using metric + MPH and my own data

2. Second set (http://www.stella-maris.org.uk/graphs2/wxgraphs_test.html) using US measurements and a US website's data

3. Third set (http://www.stella-maris.org.uk/graphs3/wxgraphs_test.html) using US measurements and another US website's data

Let me know what you think....

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jmcmurry on February 25, 2008, 07:27:13 PM
They look very very nice Stuart.  An awful lot of hard work there!  You will save many of us a lot of hours trying to figure that all out.

Thanks.  - Jim
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 25, 2008, 07:38:08 PM
The wind unit in the US set is wrong (KPH). Also shouldn't KPH be km/h ?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 25, 2008, 10:15:11 PM
The wind unit in the US set is wrong (KPH). Also shouldn't KPH be km/h ?

Yes fixing that was easy, I forgot to change it in the config file after my testing earlier. Its a one character change in one file and all the graphs are correct.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 25, 2008, 10:32:57 PM
Bit more trivia. I think mm is more customary for millimeter and I'm not sure what's correct for millibar, but MB looks like megabyte  :)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: weatherc on February 25, 2008, 10:41:21 PM
Hi!

Looking great!

Just a note what I running over when viewing the metric set, there was a time as 21.60 as in image I attached.  :wink:

Henkka
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 25, 2008, 10:52:32 PM
Bit more trivia. I think mm is more customary for millimeter and I'm not sure what's correct for millibar, but MB looks like megabyte  :)

Again this is all user customisable in the config file, if we can come to a conclusion about what is correct I can set it up as default when I create the package.

I intend to distribute it with probably 3 or 4 config files which the user can rename to the default name and get a config file already set up with USA, UK or Metric settings already there, I'll probably add one for Knots as well just for Brian and others in the sailing fraternity. As you will have noticed already its easy to forget one item.

Henkka I'll fix that 21.60 as well.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 26, 2008, 08:49:09 PM
OK guys time to try again. I hope things are sorted, fixed another couple of bugs including one I spotted!

BTW It seems that most of the units of measurement should be lower case AFAIK, so mph mb in mm but hPa needs a capital P. Anyway as I said all of the units are customisable in the config file.

1. First set (http://www.stella-maris.org.uk/graphs1/wxgraphs_test.html) using metric + MPH and my own data

2. Second set (http://www.stella-maris.org.uk/graphs2/wxgraphs_test.html) using US measurements and a US website's data

3. Third set (http://www.stella-maris.org.uk/graphs3/wxgraphs_test.html) using US measurements and another US website's data

Once again let me know what I've not spotted  :wink: :wink:

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: stumpey on February 27, 2008, 07:21:47 AM
Hi Stuart

My 24hr rain graph seems to be stuck any ideas??


Regards
Steve

Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 27, 2008, 07:42:38 AM
Steve you need to check the values in the clientraw files to see what is in there as the graph simply displays these values, you can look in the graph php file to see which file and what offset is being used and use Kevin's clientraw parser to see what is in there. I've noticed that these values dont reset when I expect it, perhaps we need to ask Brian when it should reset.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: stumpey on February 27, 2008, 08:24:25 AM
Hi Stuart

Looks like it is back to normal!! threatening to get "Brian" on to it did the trick.... :D :D

Steve
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 27, 2008, 11:39:59 PM
Stuart

Is the 12 months rain correct for the two US versions? Just seems odd that they would both have 10.6 inches in August, and also that August would be by far the max rain month.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jmcmurry on February 28, 2008, 12:11:34 AM
Niko,

I'm pretty sure that the first US site is mine and when I check August with my handy dandy new Wunderground History script, it said 10.6 inches.  Blew my sox off that it matched perfectly.

- Jim
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 28, 2008, 12:27:55 AM
Wow, I'm staying away from WI in August  #-o
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jmcmurry on February 28, 2008, 01:28:25 AM
Normally it's not that way at all, but this has been a very unusual year.

- Jim
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on February 28, 2008, 01:39:06 AM
Last time I was there was a January, that wasn't so great either  :lol:
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 28, 2008, 08:00:59 AM
Just to confirm the two US sites are Jim's and Linda's (lulu836) and the graphs use their clientraw files in real time, its not data I've archived. I've been doing last bit (hopefully)  of clean up  and final testing. I now just need to create the sample config files and then I'll put the package together and make it available. Should be done by the weekend.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 29, 2008, 09:06:26 AM
Right guys the new zip package of the JPGraphs is now available here (http://www.stella-maris.org.uk/code.shtml). I have tried to make this package more user friendly and it now contains a ReadMe.txt which hopefully explains what you need to do to install the graphs. Please do read it.

There are some new graphs and some Barometer charts are in both Bar and Line format. You must install the ARIAL TTF fonts as documented in this thread earlier. You also must create a config file from one of the template files provided, the graphs will not work unless this is done. I have created some error message images which will display if there are some basic errors in the setup.

Let me know if there are any problems....

Enjoy.....

Stuart

EDIT: If your server uses PHP4 make sure you still use the V1 JPGraph package. V2 will not work on PHP4. However the V1 package seems to run OK on PHP5.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Boce on February 29, 2008, 09:42:55 AM
Hi all,

I do a little changes to  php script and add line

$lplot->SetFillColor('blue@0.9');

It works but as i use metric data when i have negative values for temparature FillColor is not below the line but above the line. Any advice?

Thanks
Dejan
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on February 29, 2008, 10:00:20 AM
I had exactly this problem with filled line plots that have negative values and that's why in the latest set I stopped using filled graphs which could have negative values. Actually when I think about that is the way it is supposed to work to fill from the zero line.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on March 09, 2008, 02:40:00 AM
Just a quick question. I received an email and e-rice is updating to php 5.1 and I am using jpgraphs for php 4. Is it going to be a major thing to update jpgraphs. I have jpgraphs for php 5 downloaded already.

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jmcmurry on March 09, 2008, 02:43:34 AM
Chuck,

You should only need to point to the jpgraphs for PHP 5 folder in graphsconfig.  They all work fine for me.

- Jim
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on March 09, 2008, 02:45:34 AM
Sound like it should be a fairly simple thing to do. Not a lot of time right now so that is good news that it should not take that long. Thanks Jim!

Chuck

Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on March 12, 2008, 03:43:51 PM
Hi Stuart

Just downloaded your new wxgraphs.zip - but I have some troubles

The wxgraphs are uploaded to this:
www.buskelundtoften.dk/vejret/scripts/wxgraphs/

My jpgraph directory are here:
www.buskelundtoften.dk/vejret/scripts/jpgraph/

Here is what I have tried in the graphconf.php:
Code: [Select]
$hostloc = "${WEBROOT}/vejret/vejrdata/";                   //must have trailing slash
$jploc = "${WEBROOT}/vejret/scripts/jpgraph/";   //must have trailing slash

In my old graphconf.php (I have the wxgraphs working on my old setup) I use this:
Code: [Select]
$hostloc = "/vhost/buskelundtoften.dk/httpdocs/vejret/vejrdata/";                   //must have trailing slash
$jploc = "/vhost/buskelundtoften.dk/httpdocs/vejret/scripts/jpgraph/";   //must have trailing slash

Here is the link to the testpage: http://www.buskelundtoften.dk/vejret/scripts/wxgraphs/wxgraphs_test.html

What can be the problem?

Thank you very much

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 12, 2008, 06:36:58 PM
I dont know exactly, looks like you are using a Windows based web server. If you try to view the graph image on its own you can see your error message which shows a disk letter like E:\ etc as the path, take a look. It works fine on a Linux server and on Apache on my test server at home which runs Windows XP. Maybe you have IIS?

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on March 12, 2008, 06:41:01 PM
Hi Stuart

Thanks for your reply.

Yes youre right - my website runs on a Windows 2003 server. (I cant change that - my webhost has decided that for me  :?)

What do you suggest I can do?

Your old wxgraphs is working fine.

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 12, 2008, 11:51:17 PM
Well you could try changing the line to what you have in the old version and see if that works. I dont understand why IIS has to be such a PITA since the $hostloc = "${WEBROOT}/"; sataement uses what I thought was a standard variable, IIS must do something different. If anyone knows what to use for an IIS server then I can change the docs to reflect what needs changing.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on March 13, 2008, 10:49:35 AM
Hi Stuart

I changed this:

Code: [Select]
$hostloc = "${WEBROOT}/vejret/vejrdata/";                   //must have trailing slash
$jploc = "${WEBROOT}/vejret/scripts/jpgraph/";   //must have trailing slash

to

Code: [Select]
$hostloc = "/vhost/buskelundtoften.dk/httpdocs/vejret/vejrdata/";                   //must have trailing slash
$jploc = "/vhost/buskelundtoften.dk/httpdocs/vejret/scripts/jpgraph/";   //must have trailing slash

But it still dont work  :(

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 13, 2008, 11:02:37 AM
Sorry Henrik I was tired last night and missed the real problem. Its line 5 in the graphsconf file. You could try commenting that out and see what happens (still with your changes to $hostloc in place).

I need to understand why DOCUMENT_ROOT does not work in IIS. My problem is that I dont have IIS to test with, I always select a web host which provides Linux servers as they are always much easier to use and IMHO safer and less likely to be hacked etc. I have no experience of IIS.

I'll take a long look later.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on March 13, 2008, 11:09:25 AM
Hi again Stuart

Woo hoo - that did the trick - its working now.

Thank you very much for your help and theese great graphs.

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 13, 2008, 11:12:00 AM
Henrik I need to change my code as DOCUMENT_ROOT is not provided by IIS, I have found some code which works for both Apache and IIS and will test later today if I get time.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on March 13, 2008, 11:28:43 AM
Hi Stuart

That sounds good.

Let me know if you want me to test it for you on a IIS server.

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Gert on March 13, 2008, 04:25:57 PM
Hi

I wonder who are responsibe for these scripts. It could be nice if they could comply to the templates from Ken True and use the same CSS files.

Thanks

Rgds
Gert
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 13, 2008, 05:09:05 PM
Hi

I wonder who are responsibe for these scripts. It could be nice if they could comply to the templates from Ken True and use the same CSS files.

Gert I created the scripts for the graphs and they are compatible with any webpage you want to use them on. The sample HTML file is only there to do two things, one prove the installation works, and two to give you an idea of how to call the graphs from your own web page. In fact many people already have included them in their own pages of all types, Carterlake or Ken True's stuff as well as their own pages. All these scripts do is to call JPGraph to create an image to display the graph, what you do with these images is up to you.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on March 13, 2008, 07:11:59 PM
Hi

I wonder who are responsibe for these scripts. It could be nice if they could comply to the templates from Ken True and use the same CSS files.

Thanks

Rgds
Gert


Wait a minute.........these scripts were all at one time stand-alone scripts that a lot of us implemented a long time before Ken etal put them all in one package so that there is little or no work involved for newcomers to have "pretty" pages.  Suggesting that those scripts should be written to comply with the new package is just not right.  While I greatly admire what Ken and all others have done to make everything so easy I also feel that by making it so easy there is not a lot of learning going on ergo not a lot of appreciation by new forum members for just how difficult a task the package contributors have accomplished by making web pages pretty much "plug and play".  
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Gert on March 13, 2008, 09:52:16 PM
Hi Lulu836

Sorry to offend you, it was not the purpose. The purpose was just to ask, if anyone changed the scripts, so they comply to Ken's templates. I can understand from your answer, that you didn't. But maybe someone else.

Rgds
Gert

Title: Re: How to setup jpgraphs and wxgraphs
Post by: saratogaWX on March 13, 2008, 10:17:39 PM

Wait a minute.........these scripts were all at one time stand-alone scripts that a lot of us implemented a long time before Ken etal put them all in one package so that there is little or no work involved for newcomers to have "pretty" pages.  Suggesting that those scripts should be written to comply with the new package is just not right.  While I greatly admire what Ken and all others have done to make everything so easy I also feel that by making it so easy there is not a lot of learning going on ergo not a lot of appreciation by new forum members for just how difficult a task the package contributors have accomplished by making web pages pretty much "plug and play".   
Thanks for the kind words Linda!

When I put together the packaged WD/PHP/AJAX website designs using Kevin's included-file base, I had every intent of allowing all my old scripts (and others added on) to be used inside the design with minimal configuration, but also to allow all scripts (including the ajax-dashboard) to continue to be used standalone (without the template Settings.php file) in any existing website that supports PHP.

Each of my old scripts are being updated to include Settings.php $SITE awareness, but still have full configurability using the built-in settings in the individual script.

The template set is not intended to replace, but to augment.  It sure makes the building of the scripts a bit more difficult, but I think it's worth the effort so folks are free to choose to use the scripts with their existing website design, or change their website to use the included-file design.

Gert, I'm honored that you've termed it the "Ken True standard", but it's not really a standard, just a convention that folks are free to use or ignore as they please. 

My 2cents :)
Best regards,
Ken
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 13, 2008, 11:30:05 PM
The purpose was just to ask, if anyone changed the scripts, so they comply to Ken's templates. I can understand from your answer, that you didn't. But maybe someone else.

I think you have missed the point. These graphs are simply .png images and can be added to any page you may care to write or template you may care to use. There is no way for the package to be altered or customised to fit any type of page. The whole thing just gives you the ability to add the graphs you want to any page as a .png image. I really dont know what you are expecting when you say you want them to comply with Ken's templates and CSS, they do already as they are images added with the <img> html tag. If you want a template page setup to include all of the graphs then I suggest you ask Ken to add a template page to his package but as for this graph package it will not be changed by me from the current format.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 14, 2008, 09:03:56 AM
Henrik (jwwd) had been having problems with the scripts because he uses an IIS server. From what  can tell the DOCUMENT_ROOT environment variable does not exist in some IIS servers (it can be added by sysadmin I believe).

Anyway Henrik kindly allowed me to do some testing on his server and I now have modified the code in graphsconf.php so that it works with IIS and Apache to discover the correct value for DOCUMENT_ROOT even if the variable does not exist. I will upload a new package later today which fixes (hopefully) this problem. I'll post a message when the new package is available.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 14, 2008, 09:46:30 AM
I have uploaded an updated package, the only changes are the sample graphsconf files which now contain the fix for IIS servers. You only need to update if you are having problems with using an IIS server and getting the graphs to work. There are no changes to the graphs files.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on March 14, 2008, 01:24:17 PM
Hi Stuart

Thank you very much for you help - I have the wxgraphs up and running in both a Danish and English version

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 17, 2008, 08:26:04 AM
I have just uploaded a new graph package for downloading. This new version contains the ability to change the language used on the graph labels. There is a new file called graphlang.php which contains all the data strings used to add labels and titles to the graphs, by editing this file and changing the strings you can change the graphs to display in your own language. As I am completely dumb with foreign languages I have not provided any examples I'm afraid, however I will try not to change this file but simply add any new strings to the end of the file so that people can copy over any updates and not replace the whole file. Any changes in this file will be detailed in the Readme.txt.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on March 17, 2008, 12:21:04 PM
Hi Stuart

Thats a great feature - I will download it today and try it out.

I guess all my work translating the graps into Danish last week was a waste  :D'

Have a nice day

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on March 17, 2008, 12:43:04 PM
Hi again

I just installed the new version and see some minor missing translation:

- temp+dew+hum_24hr.php - the explanation is missing translation
- temp+dew+hum_1hr.php - the explanation is missing translation
- The compass letters (N W S E N)
- rain_yesterday.php - missing translation (rain)
- rain_today.php - missing translation (rain)
- rain_week.phprain_this_month.php - missing translation (rain)
- rain_this_year.php - missing translation (rain)

- all the "last 31 days graphs" - the name "date" in the right down corner is not translated

That was what I was noticing.

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 17, 2008, 01:30:56 PM
Thanks Henrik, I'll work on that later today and put up a new package. Sorry for that, it gets a bit confusing doing the testing when I only have one meaningful language to use #-o :roll:

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on March 17, 2008, 01:32:18 PM
Hi again

Its okay - im happy to test it out for you.

I can send you the graphlang.php in Danish if you like?

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 17, 2008, 01:33:42 PM
Yes please Henrik, that'll make seeing what's missing much easier. You have my email address.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on March 17, 2008, 09:28:45 PM
Hi Stuart

E-mail sent

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 17, 2008, 11:53:44 PM
Thanks Henrik, I'll have a package for you to test tomorrow when you get time. I'll email it to you.

Stuart

Edit: email sent to you Henrik...
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on March 18, 2008, 09:05:43 AM
Hi Stuart

E-mail sent

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 18, 2008, 10:31:03 AM
I have now sorted the issues Henrik found with the language file and have uploaded a new package with the fixes, and have included courtesy of Henrik a Danish sample language file. If anyone else creates a lanuage file other than English (or Danish) and would like it added please send me the file (you can find my email address via my website). So the latest zip file should now allow any language to be added to the graphs.

Thanks again to Henrik for all his help in sorting this.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: berdalweather on September 11, 2008, 04:33:03 PM
I just wanted to say thanks for this exellent package!

I installed it in 20 minutes and it works great. Now just to find the best places to put it in my website!  :lol:


Best Regards,
Martin
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on September 11, 2008, 04:34:30 PM
Glad you like it Martin.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: berdalweather on September 11, 2008, 05:22:40 PM
Glad you like it Martin.

Stuart
You wouldn't happen to know if it's possible to use the different language files for the jpgraphs when my website is set to a specific language?

If you check my main page, I've added the temperature over last 7 days graphs in the dashboard. I was wondering if I can
get it to display the text in the correct language depending on the choice for the template...

Best Regards,
Martin
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on September 11, 2008, 05:55:44 PM
If you have the latest package there is a graphlang.php file which you can edit to change the language.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on September 11, 2008, 06:09:25 PM
And that could be made selectable the same way the template pages work eg http://www.berdalweather.net/index.php?lang=en
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on September 11, 2008, 07:03:42 PM
And that could be made selectable the same way the template pages work eg http://www.berdalweather.net/index.php?lang=en

Currently I only have one other language file other than English and that's Danish, so at present I've not bothered to change the code to make it user selectable you simply rename the correct language file to graphsconf.php. Its quite easy to change by making a small change to the config file but as I'd only received one langauge file I'd not done it.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: berdalweather on September 11, 2008, 07:21:01 PM
And that could be made selectable the same way the template pages work eg http://www.berdalweather.net/index.php?lang=en
Yes, that was my point, how to get the jscript to choose between the different language files for the wxgraphic dependant on the main language selected in the Carterlake template.

I'm not so good at coding stuff from scratch, so I was hoping someone could help me out. :)


Best Regards,
Martin
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on September 11, 2008, 07:31:29 PM
Yes, that was my point, how to get the jscript to choose between the different language files for the wxgraphic dependant on the main language selected in the Carterlake template.

I'm not so good at coding stuff from scratch, so I was hoping someone could help me out. :)


Best Regards,
Martin

WEell it would need more than a simple code change in the config file as these graphs are for everyone not just those running the Carterlake Templates. Also currently there are only English and Danish available anyway. For now simply edit the graphlang file and change to your language. When I get time I'll try to add the required code to the config file and make it work with and without the templates.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: berdalweather on September 11, 2008, 07:40:09 PM
WEell it would need more than a simple code change in the config file as these graphs are for everyone not just those running the Carterlake Templates. Also currently there are only English and Danish available anyway. For now simply edit the graphlang file and change to your language. When I get time I'll try to add the required code to the config file and make it work with and without the templates.

Stuart
Thanks Stuart!

I'm just using the default English version for now, although I've created a Norwegian file as well.

Best Regards,
Martin
Title: Re: How to setup jpgraphs and wxgraphs
Post by: berdalweather on September 24, 2008, 09:43:49 PM
Hi all,

I was wondering if any of you code gurus could help me with something I'd like to do with this temp graph.
I'd like to make it fill the below zero temperatures with blue, and the above zero temperatures with red.
Also, change the plot line from a fixed color to the same, ie. red if above zero and blue if below zero.

Here's the graph:

(http://www.berdalweather.net/wxgraphs/temp+dew+hum_24hr.php)

And here's my current code (don't pay so much attention to the colors I've chosen etc it's just for testing):

Code: [Select]
<?php
// Graphs Package V2.1 16th March 2008
if (!file_exists("graphsconf.php")) include("error_msg.php");
include (
"graphsconf.php");
if (!
file_exists($jploc."jpgraph.php")) {
  
$string "Unable to find JPGraph files";
  
create_image1($string,$jploc);
  exit;
}
include (
$jploc."jpgraph.php");
include (
$jploc."jpgraph_line.php");

$clientrawextra get_raw("${hostloc}clientrawextra.txt");

//temp=========================================================================
$y=array($clientrawextra['21'],$clientrawextra['22'],$clientrawextra['23'],$clientrawextra['24'],
$clientrawextra['25'],$clientrawextra['26'],$clientrawextra['27'],$clientrawextra['28'],$clientrawextra['29'],
$clientrawextra['30'],$clientrawextra['31'],$clientrawextra['32'],$clientrawextra['33'],$clientrawextra['34'],
$clientrawextra['35'],$clientrawextra['36'],$clientrawextra['37'],$clientrawextra['38'],$clientrawextra['39'],
$clientrawextra['40'],$clientrawextra['566'],$clientrawextra['567'],$clientrawextra['568'],$clientrawextra['569']);
$datay $y;




if (
$temp_conv == 1.8) {
array_walk($datay"CtoF");
}

//Check for negative values in array and do a SetAuotMin(0) if none
array_walk($datay"NegVal");
$negvalue1 $negvalue;

// Check for positive values in array
array_walk($datay"PosVal");
$posvalue1 $posvalue;

$negvalue 0;
$posvalue 0;

if ((
$negvalue1 == 1) or ($negvalue3 == 1)) $negvalue 1;
if ((
$posvalue1 == 1) or ($posvalue3 == 1)) $posvalue 1;
if ((
$negvalue1 == 0) and ($negvalue3 == 0)) $negvalue 0;
if ((
$posvalue1 == 0) and ($posvalue3 == 0)) $posvalue 0;

if (
$negvalue == 0) {
  if (
$temp_conv == 1$automin '$graph->yaxis->scale->SetAutoMin(0);';
  if (
$temp_conv == 1.8$automin '$graph->yaxis->scale->SetAutoMin(32);';
  
$grace '$graph->yaxis->scale->SetGrace(5);';
}
if ((
$negvalue == 1) and ($posvalue == 0)) {
  if (
$temp_conv == 1$automin '$graph->yaxis->scale->SetAutoMax(0);';
  if (
$temp_conv == 1.8$automin '$graph->yaxis->scale->SetAutoMax(32);';
  
$grace '$graph->yaxis->scale->SetGrace(0,5);';
}
if ((
$negvalue == 1) and ($posvalue == 1)) {
  
$automin '';
  
$grace '$graph->yaxis->scale->SetGrace(5,5);';
}

//create timearray for the x-axis
$x=array($clientrawextra['459'],$clientrawextra['460'],$clientrawextra['461'],$clientrawextra['462'],
$clientrawextra['463'],$clientrawextra['464'],$clientrawextra['465'],$clientrawextra['466'],$clientrawextra['467'],
$clientrawextra['468'],$clientrawextra['469'],$clientrawextra['470'],$clientrawextra['471'],$clientrawextra['472'],
$clientrawextra['473'],$clientrawextra['474'],$clientrawextra['475'],$clientrawextra['476'],$clientrawextra['477'],
$clientrawextra['478'],$clientrawextra['578'],$clientrawextra['579'],$clientrawextra['580'],$clientrawextra['581']);
$datax $x;

// Create the graph and specify the scale for both Y-axis
$graph = new Graph($xsize,$ysize,"auto",30);    
$graph->SetScale("textlin");

$graph->SetShadow();
$graph->SetMarginColor("$margincolour");

// Adjust the margin
$graph->SetMargin($lm,$rm,$tm,$bm);

// Create the two linear plot
$lplot1=new LinePlot($datay);    // Temp






// Add the plot to the graph
$graph->Add($lplot1);


//titles
//$graph->title->Set("$txt_temp - Last 24 hrs ($temp_unit)");
//$graph->title->Align("center","top");
//$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
//$graph->title->SetColor("$textcolour");

//x-axis
//$graph->xaxis->title->SetColor("$xtextcolour");
//$graph->xaxis->title->Set("$txt_24h");
//$graph->xaxis->title->SetFont(FF_ARIAL,FS_BOLD,8);
$graph->xaxis->SetFont(FF_ARIAL,FS_BOLD,8);
$graph->xaxis->SetTitlemargin(25);
$graph->xaxis->SetLabelMargin(10);
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetLabelAngle($label_angle);
$graph->xaxis->SetTextLabelInterval($label_interval);
$graph->xaxis->SetPos("min"); 
$graph->xaxis->HideTicks(true,true); 
$graph->xaxis->SetColor("$xtextcolour"); 
$graph->xgrid->Show(true);

//y-axis
$graph->yaxis->SetFont(FF_ARIAL,FS_BOLD,8);
$graph->yaxis->SetColor("$ytextcolour");
$graph->yaxis->SetLabelFormat("%0.0f");
$graph->yaxis->HideTicks(false,false);
eval(
$automin);
eval(
$grace);

//y2-axis
//$graph->y2axis->SetFont(FF_ARIAL,FS_BOLD,8);
//$graph->y2axis->SetColor("$y2textcolour");
//$graph->yaxis->SetLabelFormat("$temp_format");
//$graph->y2axis->HideTicks(true,true); 
//$graph->y2axis->scale->SetAutoMin(0);

// Set the colors for the plots

if (($negvalue1 == 0) and ($posvalue1 == 1)) $lplot1->SetColor("$temp_col1");
if ((
$negvalue1 == 1) and ($posvalue1 == 0)) $lplot1->SetColor("$temp_col2");
if ((
$negvalue1 == 1) and ($posvalue1 == 1)) $lplot1->SetColor("$temp_col3");

if ((
$negvalue1 == 1) and ($posvalue1 == 0)) $lplot1->SetFillColor("#ff3300@0.5");
if ((
$negvalue1 == 1) and ($posvalue1 == 1)) $lplot1->SetFillColor("#3366ff@0.5");
$lplot1->SetWeight(1);




// Setup a background gradient image
$graph->SetBackgroundGradient('white','navy:0.5',GRAD_HOR,BGRAD_PLOT);

// Set the legends for the plots
//$graph->legend->SetFont(FF_ARIAL,FS_NORMAL,7);
//$lplot1->SetLegend("$txt_temp1");

// Adjust the legend position
//$graph->legend->SetLayout(LEGEND_HOR);
//$graph->legend->Pos(0.02,0.01,'right','top');

// Display the graph
$graph->Stroke();

?>

Best Regards,
Martin
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on October 03, 2008, 09:28:17 AM
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
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jwwd on October 03, 2008, 01:47:17 PM
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

Hi Stuart

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

Best regards,

Henrik
Title: Re: How to setup jpgraphs and wxgraphs
Post by: mdkleer on October 07, 2008, 07:46:27 PM
Hi all,

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

Quote
$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
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on October 07, 2008, 09:52:24 PM
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
Title: Re: How to setup jpgraphs and wxgraphs
Post by: mdkleer on October 08, 2008, 05:28:27 AM
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
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on October 08, 2008, 07:53:57 AM
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
Title: Re: How to setup jpgraphs and wxgraphs
Post by: mdkleer on October 08, 2008, 06:36:18 PM
 :D :D Yes yes it's working !!!! :D :D

Take a look http://www.weerstationloosduinen.nl/wxabout.php?lang=en (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
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on October 30, 2008, 06:45:28 PM
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
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 30, 2008, 06:51:45 PM
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."

Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on October 30, 2008, 07:15:16 PM
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 C = 65.5 F
182   Temp Last 60 for Min 02   C   18.7 C = 65.7 F
183   Temp Last 60 for Min 03   C   18.7 C = 65.7 F
184   Temp Last 60 for Min 04   C   18.8 C = 65.8 F
185   Temp Last 60 for Min 05   C   18.8 C = 65.8 F
186   Temp Last 60 for Min 06   C   18.9 C = 66 F
187   Temp Last 60 for Min 07   C   18.9 C = 66 F
188   Temp Last 60 for Min 08   C   18.9 C = 66 F
189   Temp Last 60 for Min 09   C   18.9 C = 66 F
190   Temp Last 60 for Min 10   C   19.0 C = 66.2 F
191   Temp Last 60 for Min 11   C   19.1 C = 66.4 F
192   Temp Last 60 for Min 12   C   19.1 C = 66.4 F
193   Temp Last 60 for Min 13   C   19.1 C = 66.4 F
194   Temp Last 60 for Min 14   C   19.1 C = 66.4 F
195   Temp Last 60 for Min 15   C   19.1 C = 66.4 F
196   Temp Last 60 for Min 16   C   19.1 C = 66.4 F
197   Temp Last 60 for Min 17   C   19.1 C = 66.4 F
198   Temp Last 60 for Min 18   C   19.1 C = 66.4 F
199   Temp Last 60 for Min 19   C   19.2 C = 66.6 F
200   Temp Last 60 for Min 20   C   19.2 C = 66.6 F
201   Temp Last 60 for Min 21   C   19.2 C = 66.6 F
202   Temp Last 60 for Min 22   C   19.3 C = 66.7 F
203   Temp Last 60 for Min 23   C   19.3 C = 66.7 F
204   Temp Last 60 for Min 24   C   19.3 C = 66.7 F
205   Temp Last 60 for Min 25   C   19.3 C = 66.7 F
206   Temp Last 60 for Min 26   C   19.3 C = 66.7 F
207   Temp Last 60 for Min 27   C   19.3 C = 66.7 F
208   Temp Last 60 for Min 28   C   19.4 C = 66.9 F
209   Temp Last 60 for Min 29   C   19.4 C = 66.9 F
210   Temp Last 60 for Min 30   C   19.4 C = 66.9 F
211   Temp Last 60 for Min 31   C   19.4 C = 66.9 F
212   Temp Last 60 for Min 32   C   19.4 C = 66.9 F
213   Temp Last 60 for Min 33   C   19.4 C = 66.9 F
214   Temp Last 60 for Min 34   C   19.4 C = 66.9 F
215   Temp Last 60 for Min 35   C   19.4 C = 66.9 F
216   Temp Last 60 for Min 36   C   19.4 C = 66.9 F
217   Temp Last 60 for Min 37   C   19.4 C = 66.9 F
218   Temp Last 60 for Min 38   C   19.4 C = 66.9 F
219   Temp Last 60 for Min 39   C   19.4 C = 66.9 F
220   Temp Last 60 for Min 40   C   19.4 C = 66.9 F
221   Temp Last 60 for Min 41   C   19.4 C = 66.9 F
222   Temp Last 60 for Min 42   C   19.4 C = 66.9 F
223   Temp Last 60 for Min 43   C   19.5 C = 67.1 F
224   Temp Last 60 for Min 44   C   19.5 C = 67.1 F
225   Temp Last 60 for Min 45   C   19.5 C = 67.1 F
226   Temp Last 60 for Min 46   C   19.5 C = 67.1 F
227   Temp Last 60 for Min 47   C   19.5 C = 67.1 F
228   Temp Last 60 for Min 48   C   19.5 C = 67.1 F
229   Temp Last 60 for Min 49   C   19.5 C = 67.1 F
230   Temp Last 60 for Min 50   C   19.5 C = 67.1 F
231   Temp Last 60 for Min 51   C   19.5 C = 67.1 F
232   Temp Last 60 for Min 52   C   19.5 C = 67.1 F
233   Temp Last 60 for Min 53   C   19.5 C = 67.1 F
234   Temp Last 60 for Min 54   C   19.5 C = 67.1 F
235   Temp Last 60 for Min 55   C   19.5 C = 67.1 F
236   Temp Last 60 for Min 56   C   19.5 C = 67.1 F
237   Temp Last 60 for Min 57   C   19.5 C = 67.1 F
238   Temp Last 60 for Min 58   C   19.6 C = 67.3 F
239   Temp Last 60 for Min 59   C   19.6 C = 67.3 F
240   Temp Last 60 for Min 60   C   19.6 C = 67.3 F

Chuck

Edit: Here is a link to my old baro 1 hr graph.

http://www.chucksweather.com/graphs/baro_1h_in.php
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 30, 2008, 07:18:54 PM
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.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on October 30, 2008, 07:45:37 PM
I have it updating every 5 minutes. It is under the real time tab to upload every 5 minutes.
Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 30, 2008, 07:49:24 PM
Oh well, then Kevin's document is out of date, and I'm wrong. Sorry  :(
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on October 30, 2008, 07:58:52 PM
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
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 30, 2008, 11:09:56 PM
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?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on October 30, 2008, 11:25:32 PM
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
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 31, 2008, 12:40:11 AM
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.

(http://www.realweatherstation.com/FILES/shuffle.gif)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Weather Display on November 01, 2008, 02:02:35 AM
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
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on November 01, 2008, 02:17:20 AM
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.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on November 01, 2008, 08:24:31 AM
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
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on November 01, 2008, 01:09:33 PM
Stuart,

Do you want me to send you my old 1 hr graphs to take a look at. Let me know.

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on November 01, 2008, 02:14:40 PM
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

WDL doesn't use a real timestamp, the axis runs from -60 to 0.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on November 01, 2008, 03:51:27 PM
WDL doesn't use a real timestamp, the axis runs from -60 to 0.

Well in that case WDL is showing an invalid x axis on my graphs because my clientrawhour.txt is only updated once per hour at 59 minutes past the hour, so I'll raise a thread for Julian to look at. As for the graphs I'll look later at how I might do it.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on November 01, 2008, 04:50:07 PM
Please see this thread (http://www.weather-watch.com/smf/index.php/topic,35359.0/topicseen.html) for Julian's comments on the clientrawhour.txt problem. Since we are using data which Brian creates for WDL I'm inclined to leave the jpgraph code as is for now and wait for the outcome of this other thread. Julian seems to feel a timestamp is needed.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on November 01, 2008, 05:10:14 PM
Yes, I agree, a time stamp would be the best solution.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on February 06, 2009, 01:34:54 AM
Im getting there on setting up these graphs..

http://www.snoqualmieweather.com/wxgraphs/rain_1hr.php

There error Im getting is for the fonts. But I cant seem to find in what file to change the path to my folder where the fonts are. If anyone knows off hand, that would be great. Thanks, Mark.


UPDATE: I got it fixed...Now onto other issues...lol
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on February 06, 2009, 02:36:56 AM
Got to your jpgraph.php under the src folder and look for this. See the last line DEFINE('TTF_DIR','/virtual/users/e14497-14796/web/graphs/jp/ttf/'); thats where you configure your fonts. This is the way I have it set up. Mine is around line 46 or so.

Code: [Select]
if (!defined('TTF_DIR')) {
    if (strstr( PHP_OS, 'WIN') ) {
$sroot = getenv('SystemRoot');
        if( empty($sroot) ) {
    $t = new ErrMsgText();
    $msg = $t->Get(12,$file,$lineno);
    die($msg);
        }
else {
  DEFINE('TTF_DIR', $sroot.'/fonts/');
        }
    } else {
DEFINE('TTF_DIR','/virtual/users/e14497-14796/web/graphs/jp/ttf/');

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on February 06, 2009, 02:46:09 AM
Thanks Chuck...I got that figured out...Now im trying to get them all aligned on my page...The bottom graphs are shifting to the left...So thats what Im fighting with now..Then Id like to work on changing the backgrounds on the graphs themselves.

a temp page

http://www.snoqualmieweather.com/pagetemplate.php
Title: Re: How to setup jpgraphs and wxgraphs
Post by: lulu836 on February 06, 2009, 04:03:51 AM
I had JPGraphs on my old site.........Graphweather makes much better looking ones without all the hassle.  Just my humble opinion :D
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 05, 2009, 01:02:48 AM
trying to set these graphs back up on php v5 and I'm getting a weird error. They worked no prob on v4. i did download the files for v5, so thats not a problem. Heres the link with the error..

http://www.snoqualmieweather.com/wxgraphs/baro_7days.php

Code: [Select]
if ($family >= FF_MINCHO && $family <= FF_PGOTHIC) {                      <<<<<<Line 386
    $f = MBTTF_DIR.$f;
} else {
    $f = TTF_DIR.$f;


I have all the fonts and folders in the right place, just like how they were when I had v4.

Any ideas would be great..Thanks, Mark.

Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on March 05, 2009, 02:12:36 AM
Mark,

I took a look at your page source and the the graphs path are different on a couple not sure if that is the issue. I assume they are all in the same directory.

<tr>
    <td><img src="./web/wxgraphs/temp_7days.php /">
</td>
    <td><img src="wxgraphs/temp+hum_24hr.php /">
</td>
</tr>
<tr>
    <td><img src="rain_7days.php /">
</td>
    <td><img src="../wxgraphs/rain_24hr.php /">

</td>
</tr>
<tr>
    <td><img src="./wxgraphs/baro_7days.php /"></td>
    <td><img src="./wxgraphs/baro_24hr.php /"></td>
</tr>
<tr>
    <td><img src="./wxgraphs/windspeed_7days.php /"></td>
    <td><img src="./wxgraphs/windspeed_24hr.php /"></td>
</tr>
<tr>
    <td><img src="./wxgraphs/solar_7days.php /"></td>

    <td><img src="./wxgraphs/solar_24hr.php /"></td>


Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 05, 2009, 02:16:17 AM
I did that yesterday messing with it cause of a directory change, but that didnt affect anything. The link I provided in my previous post is a direct link to a graph. if it works there, then it should work on the page.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on March 05, 2009, 02:23:03 AM
Did you check your jpg-config.inc.php and set the directories. I assume that you did. Sorry if I am repeating things. It could be something to do with the new file because I do not have it jpgraph_ttf.inc.php.

// Directories for cache and font directory.
//
// CACHE_DIR:
// The full absolute name of the directory to be used to store the
// cached image files. This directory will not be used if the USE_CACHE
// define (further down) is false. If you enable the cache please note that
// this directory MUST be readable and writable for the process running PHP.
// Must end with '/'
//
// TTF_DIR:
// Directory where TTF fonts can be found. Must end with '/'
//
// The default values used if these defines are left commented out are:
//
// UNIX:
//   CACHE_DIR /tmp/jpgraph_cache/
//   TTF_DIR   /virtual/users/e14497-14796/web/graphs/jp/ttf/
//   MBTTF_DIR /usr/share/fonts/ja/TrueType/
//
// WINDOWS:
//   CACHE_DIR $SERVER_TEMP/jpgraph_cache/
//   TTF_DIR   $SERVER_SYSTEMROOT/fonts/
//   MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
//
//------------------------------------------------------------------------
// DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");
// DEFINE("TTF_DIR","/virtual/users/e14497-14796/web/graphs/jp/ttf/");
// DEFINE("MBTTF_DIR","/usr/share/fonts/ja/TrueType/");

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 05, 2009, 02:28:39 AM
i do have this under the main section where it says to change it..

// define("TTF_DIR","/virtual/users/e16108-17165/web/jpgraph-2.3.4/ttf/");


But I didnt change the windows or unix section. i never had to do that before.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on March 05, 2009, 02:39:33 AM
Here is another repeater probably. Under the jpgraph.php. Just trying to cover everything I can think of. :wink:

if (!defined('TTF_DIR')) {
    if (strstr( PHP_OS, 'WIN') ) {
   $sroot = getenv('SystemRoot');
        if( empty($sroot) ) {
       $t = new ErrMsgText();
       $msg = $t->Get(12,$file,$lineno);
       die($msg);
        }
   else {
     define('TTF_DIR', $sroot.'/fonts/');
        }
    } else {
   define('TTF_DIR','/usr/share/fonts/truetype/');
    }

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 05, 2009, 02:45:31 AM
Yeah..thats the same. Im starting to wonder If its the fonts I uploaded from the windows folder. But ive uploaded new font files. But for some reason, i think they may be the problem.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on March 05, 2009, 03:30:09 AM
I am sort of stuck on this one. I downloaded the newer version 2.3.4 and there are some new files incorporated.

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 05, 2009, 03:36:55 AM
Yeah....I was using the v4 one before, and it worked fine. But this one has me stuck.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 05, 2009, 08:49:13 AM
Yeah....I was using the v4 one before, and it worked fine. But this one has me stuck.

Well I just took a look at the error from one of your graphs and it says 'open_basedir restriction in effect' which if I'm correct says that anything your web server is going to access has to be within the specified root directory for your wweb server (ie. where you put your pages and stuff) so if you have a path with starts outside of that directory it will fail.

In this case you have /usr/share/fonts/truetype/arialbd.ttf which is a full unix path relative to the absolute root directory and wont open, you have to have a fonts directory within your normal web stuff and point to it. So I think you should try something like making a directory called fonts in your normal structure and just specify it as fonts/.

This is nothing to do with JPGrpahs per se, its caused by a PHP5 restriction and the way you are specifying your path. My JPGraphs work fine on PHP5.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 05, 2009, 12:30:15 PM
Thanks. Then it has to do with e-rice making you upload your files to the /web folder directory. i know it has nothing to do with jpgraphs cause it worked fine on my last host.  Im still a bit confused on what you suggested to do to fix this.  Just make a new folder called fonts and change the path in what file? Thanks.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 05, 2009, 01:41:44 PM
The jpgraph-config-inc.php file contains the line where you set the path to your own font files. This is documented in the install instructions.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 05, 2009, 01:56:20 PM
Oh..Ok...Now i get it. I'll give that a try after work today...Thanks
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 06, 2009, 12:05:22 AM
Heres where Im at now on this problem. Ive made a new directory called fonts, and uploaded the 2 font files its asks for to that folder. Still nothing. Then i changed this part in the config file..

Code: [Select]
// define("TTF_DIR","/virtual/users/e16108-17165/web/jpgraph-2.3.4/ttf/");

But nothing with that either.

I then tried to change this part...Since this is the part that actually shows up in the error..

Code: [Select]

TTF_DIR   /usr/share/fonts/truetype/

No matter how i change that part, the error still shows the samething, and same path.

Ive now changed everything back to the original settings.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on March 06, 2009, 02:23:59 AM
Try these. Don't forget to remove the "//"

Code: [Select]
define("TTF_DIR","/web/jpgraph-2.3.4/ttf/");
define("TTF_DIR","/jpgraph-2.3.4/ttf/");
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 06, 2009, 02:34:30 AM
I tried each of those in this area, and none of them worked. i hope thats what you meant for me to try.

Code: [Select]
// define("CACHE_DIR","/tmp/jpgraph_cache/");
// define("TTF_DIR","/jpgraph-2.3.4/ttf/");
// define("MBTTF_DIR","/usr/share/fonts/ja/TrueType/");



Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on March 06, 2009, 02:48:25 AM
All those lines have // in front of them, that usually means they are commented out so the program ignores them  :?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 06, 2009, 02:58:30 AM
Heres the whole setting options...

Code: [Select]

// UNIX:
//   CACHE_DIR /tmp/jpgraph_cache/
//   TTF_DIR  /web/jpgraph-2.3.4/ttf/
//   MBTTF_DIR /usr/share/fonts/ja/TrueType/
//
// WINDOWS:
//   CACHE_DIR $SERVER_TEMP/jpgraph_cache/
//   TTF_DIR   $SERVER_SYSTEMROOT/fonts/
//   MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
//
//------------------------------------------------------------------------
// define("CACHE_DIR","/tmp/jpgraph_cache/");
// define("TTF_DIR","/jpgraph-2.3.4/ttf/");
// define("MBTTF_DIR","/usr/share/fonts/ja/TrueType/");


Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on March 06, 2009, 03:02:44 AM
Right, and none of those lines are being read because of the //
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 06, 2009, 03:06:28 AM
I know. But I never had to mess with any of that before. Thats what has me so lost in this.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on March 06, 2009, 03:08:20 AM
My guess is that's because your previous host had the fonts installed in the default directory where the graphs look for them. e-rice doesn't have the fonts installed so that's why you need to make some changes.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 06, 2009, 03:13:37 AM
i actually made some progress...lol

http://www.snoqualmieweather.com/wxgraphs/solar_24hr.php
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 06, 2009, 03:37:45 AM
wow...finally got them back working...time for a beer...lol

http://www.snoqualmieweather.com/wxgraphs/rain_7days.php

Thanks Niko.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on March 06, 2009, 03:39:33 AM
Mark,

Did you fix them by taking the // off the directories you needed for the fonts.

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on March 06, 2009, 03:40:04 AM
Well done, what was the fix?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 06, 2009, 03:42:44 AM
Mark,

Did you fix them by taking the // off the directories you needed for the fonts.

Chuck

I tried that lastnight and it didnt work. But i must have fixed something else and removing the // did the trick.
Now another funny thing is, i cant get them to show back up on my page. But least there working.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 06, 2009, 03:56:17 AM
I just put in the whole url to to the graph, and it still doesnt show up on the page...

<img src="http://www.snoqualmieweather.com/wxgraphs/rain_7days.php /">

But going to the link it works fine.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on March 06, 2009, 04:04:05 AM
I might have found the problem. Your forward slash is in the the wrong place.

 <img src="http://www.snoqualmieweather.com/wxgraphs/rain_7days.php /">

    <img src="./wxgraphs/temp+hum_24hr.php /">

Should be like this Mark.

<img src="http://www.snoqualmieweather.com/wxgraphs/rain_7days.php" />

    <img src="./wxgraphs/temp+hum_24hr.php" />

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 06, 2009, 04:07:46 AM
Yup...That did the trick. Thanks.. Its amazing all the things you have to change just by changing hosts.

I'm still interested in those other graphs too Chuck.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on March 06, 2009, 04:14:21 AM
Okay no problem. I have spent enough time on this computer today. My logged in time is climbing now over 75 days.

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on March 06, 2009, 04:15:22 AM
LOL...not bad...Im at 62 days and just little over a year into it. Think im going for a record.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: rafid on March 29, 2009, 09:23:58 PM
i hope not OT!

from novice...
a new input for people who have time.. (holiday for es!..near eggs time!) 
see this http://www.fusioncharts.com (http://www.fusioncharts.com) , partially free, a pseudo flash impressive chart,
i dont know if is possible to integrate but is vy beautifoul... 

ciao
Title: Re: How to setup jpgraphs and wxgraphs
Post by: steve26 on April 09, 2009, 07:28:28 PM
Hello, if you like flash and chart, you have this solution : http://www.weather-watch.com/smf/index.php/topic,31434.0.html

And http://www.weather-watch.com/smf/index.php/topic,39057.0.html
Title: Re: How to setup jpgraphs and wxgraphs
Post by: magical46 on April 16, 2009, 11:13:45 AM
Hi All
I am trying to install jpgraphs. I think I have followed the instructions ( I am a complete novice at this) and just to test if its working have added
Quote
<img src="/wxgraphs/rain_1hr.php /">
to my graphs page. But all I'm getting is the little red x where the graph should be.
Probably missed some vital instruction somewhere. Any help much appreciated.
Here's the link to the page http://www.weybourneweather.co.uk/wxgraphs.php (http://www.weybourneweather.co.uk/wxgraphs.php)

Phil
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on April 16, 2009, 03:19:52 PM
it works if you go here..

http://www.weybourneweather.co.uk/wxgraphs/rain_1hr.php

Do you have a typo or path wrong somewhere?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: magical46 on April 16, 2009, 03:24:53 PM
hi
Been messing about with all day. think I got it sorted now. Thanks to all.
http://www.weybourneweather.co.uk/wxcharts.php (http://www.weybourneweather.co.uk/wxcharts.php)

Phil
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Dobbies on June 21, 2009, 11:39:37 AM
I would like to take this opportunity to thank all the main players and contributors of the whole site and of this thread. I'm a novice of 6 months at running my own weather station and I try to better it all the time. Nothing is straight forward, but if you search and read the posts here you can find the answers to your problems.
My most recent achievement is to learn the basics of "how to set up jpgraphs and wxgraphs" by Tim hanko. Easy for some difficult for others! :D

Many thanks to all


Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on September 29, 2009, 11:12:28 PM
 I have 5 graphs working great for almost a year now, and they still are. Now im working on setting up the 24 UV and 7 day UV graphs and not having much luck. Im getting the same error for both graphs. The file attached is the 7-day uv and the error is on line 44.. $graph->SetScale("textlin");


http://www.snoqualmieweather.com/uv_7days.php

If i can get this one working, im sure the 24 uv will work too, cause they both have the same error.
Thanks, Mark.

The uv graphs should look like these..
http://www.snoqualmieweather.com/wxgraphs.php
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on September 30, 2009, 02:18:57 AM
Did you try removing that line. I don't have that line in any of my OFC scripts.

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on September 30, 2009, 06:42:06 AM
Mark my JPGraph package has both these graphs in it. You can download the entire package here (http://www.stella-maris.org.uk/code/wxgraphs.zip). I realise you're using OFC charts but hope this code might help.....

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ALITTLEweird1 on September 30, 2009, 11:33:41 AM
Chuck helped me get the 2 graphs going lastnight, Thanks Stuart.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: drobbins on October 24, 2009, 06:17:15 PM
I browsed through the 16 pages here & I didn't see if this was answered or not. I just set everything up today and it is not producing graphs:
http://www.cavecountryweather.com/Test.php (http://www.cavecountryweather.com/Test.php)
Any Ideas?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 24, 2009, 06:24:36 PM
Work the errors one by one:

Warning: include(graphlang.php) [function.include]: failed to open stream: No such file or directory in /virtual/users/e15586-16411/web/wxgraphs/graphsconf.php on line 101

Where is your graphlang.php file?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: drobbins on October 24, 2009, 06:36:39 PM
Where is your graphlang.php file?
 :oops: Uh.. It was in the recycle bin  :oops: #-o. I thought it was one of the unneeded config files.
It is now in the wxgraphs folder.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 24, 2009, 06:41:41 PM
Hmmm, well that's a step forward, now it's creating an image but it's "unable to find jpgraph files" so I think you have more file location issues  :(
Title: Re: How to setup jpgraphs and wxgraphs
Post by: drobbins on October 24, 2009, 07:14:19 PM
If I use these settings:
Code: [Select]
$hostloc = "${WEBROOT}/";                   //must have trailing slash
$jploc = "${WEBROOT}/jpgraph-3.0.5/src/";   //must have trailing slash
I get the first picture below (JP Graph1)

If I use these settings:
Code: [Select]
$hostloc = "http://www.cavecountryweather.com/";                   //must have trailing slash
$jploc = "http://www.cavecountryweather.com/jpgraph-3.0.5/src/";
I get the second picture below (JP Graph2). Which one is moving in the right direction?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 24, 2009, 07:41:26 PM
I think the first one.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: drobbins on October 24, 2009, 08:45:14 PM
Ok It is set up like the first example. Now when I try to go directly to the PHP file: http://www.cavecountryweather.com/wxgraphs/rain_1hr.php (http://www.cavecountryweather.com/wxgraphs/rain_1hr.php)
This error message used to appear: "Chosen locale file ("lang/en.inc.php") for error messages does not exist or is not readable for the PHP process. Please make sure that the file exists and that the file permissions are such that the PHP process is allowed to read this file."

I could not find the "lang/en.inc.php" file anywhere, so I went back to the original zip file and for some reason the entire "lang" folder was not unzipped or installed.  It is now, and I am getting a new error. It states that the /ttf/hardpath.php file is not readable or does not exist. It does exist because I can see it. http://www.cavecountryweather.com/jpgraph-3.0.5/ttf/hardpath.php (http://www.cavecountryweather.com/jpgraph-3.0.5/ttf/hardpath.php)
Any ideas?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: drobbins on October 24, 2009, 09:35:32 PM
Well, I just repeated step #9
Quote
9. Edit jpg-config.inc.php in the jpgraph-x.xx/src folder:
   a. Uncomment the line that begins with DEFINE("TTF_DIR",". (Line 40 in my editor)
   b. Replace the default path with the result of browsing to hardpath.php.

And now it is working   :dontknow:  :D
Thanks for the help.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 24, 2009, 11:05:54 PM
Good job!
Title: Re: How to setup jpgraphs and wxgraphs
Post by: drobbins on October 25, 2009, 12:14:18 AM
I used them to update the Weather Graphs page. This was also my first shot at really messing around with tables.
http://www.cavecountryweather.com/graphs.php (http://www.cavecountryweather.com/graphs.php)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: arthurhh on October 25, 2009, 08:18:33 AM
I am currently working on updating my present graphs page to a new template based package. http://tokoroa.dyndns.org/wxgraphs.php (http://tokoroa.dyndns.org/wxgraphs.php) not displaying correctly at the moment while I work on the scripts.
once I finish the package you will be able to take the ZIP file unpack it, upload to your server and it will work (Of course there will be the obligatory change of a couple of variables in the config file) It will work for all carter lake metric template sites.

You can see the pages in development at http://tokoroa.dyndns.org/wxgraphs2.php#Solar (http://tokoroa.dyndns.org/wxgraphs2.php#Solar) I am currently up to Humidity.

I have yet to investigate the distribution of JPGraph within the archive I intend to make available, so there may be some install requirements for this yet.

As an adjunct I am also working on a higher resolution set of graphs for our local groups comparison page http://tokoroa.dyndns.org/wxcomparision.php (http://tokoroa.dyndns.org/wxcomparision.php)using WD custom log files, giving graphs with 5 minute resolution instead of hours. We expect to have six stations in a area of about 20km sq soon, something of an achievement really for a town of 16,000.

My weather position, for me it is present the best data in the best understandable way, but having it as accurate as possible. I am not a storm chaser or even a over committed weather man, just a IT geek with an interest.

Title: Re: How to setup jpgraphs and wxgraphs
Post by: gclarkso on November 21, 2009, 06:27:22 AM
Wow! Thanks to the concise instructions, as well as looking over the previous posts, the graphs were setup in a jiffy.

Graphs Page (http://oldlineweather.com/wxgraphs.php)

Thank you!

I would like to ask though...

My 31 day avg wind dir plot is empty (as is Stuarts' here (http://www.stella-maris.org.uk/wxgraphs.phtml))

Is there an easy fix for this?


Thank you,
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SandhurstWX on November 23, 2009, 07:23:21 PM
Although I don't use the last 31 Days Averaged Direction graph on my site, I have it on my test page, and mine is also all at 0 deg. Running my clientrawdaily.txt file through the TNET Weather Station's (http://www.tnetweather.com/wd-parser.php) clientraw data parser, I see that the data fields 155 to 186 are all reading -0.0 deg. All other graphs seem to be running OK.

Has something changed in the clientrawdaily.txt format?

Title: Re: How to setup jpgraphs and wxgraphs
Post by: gclarkso on November 26, 2009, 03:28:36 PM
I would like to ask though...

My 31 day avg wind dir plot is empty.

Is there an easy fix for this?

This has been fixed with the latest (37P-build 12) release.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Soulmaster on February 06, 2010, 11:08:57 AM
http://www.weerstationmedemblik.nl/wxgraphs/solar_7days.php whats wrong ? it works perfectly for a few days ago and now its broken :( Nothings changed

same overhere http://www.weerstationmedemblik.nl/overzicht-31-dagen.html


found the problem, the extra raw files were corrupt. fixed.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: magical46 on March 08, 2010, 09:20:04 PM
I accidently deleted the jpgraph files from my web server whilst makimg some changes, no problem I thought as I still had the files stored on my pc. I uploaded them again but now have this error showing, see herehttp://www.weybourneweather.co.uk/wxcharts.php (http://www.weybourneweather.co.uk/wxcharts.php).
The ttf directory seems to have disappeared and I can't find it anywhere, can any one point me as to where to find these files, they are not on my local jpgraph file on my pc. I must have had it all sorted out before as the graphs were all working for the last year or so until my boo boo today #-o
Phil
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jmcmurry on March 08, 2010, 10:37:42 PM
You can look in your windows folder to wherever the fonts are and grab a copy of aerial bold there.  You will have to name it to exactly what jpgraph is looking for and of course put it in a /ttf/ folder under your jpgraphs where it is looking for it.

- Jim
Title: Re: How to setup jpgraphs and wxgraphs
Post by: magical46 on March 08, 2010, 10:51:00 PM
Jim
Thanks for that, that did the trick. Don't understand why the fonts vanished  from the jpgraph folder in the first place but at least the graphs are working now  :)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jmcmurry on March 08, 2010, 11:34:19 PM
Good deal that it works now.  You must have added that folder and the fonts to the web copy but not to the copy on your hard drive.

- Jim
Title: Re: How to setup jpgraphs and wxgraphs
Post by: AK7V on August 03, 2010, 03:09:45 PM
I am having a problem with the last hour graphs on my website.

http://www.wrightwoodweather.com/wxjgraphs.php?wxj_span=hour

clientrawhour.txt is being uploaded every 5 minutes, and the graphs reflect the new incoming data, but the x-axis only changed hourly, and is an hour behind.  The axis will be labeled, for example, 7:00 to 8:00 from 8:00 until 9:00.  Then it will be labeled 8:00-9:00 until 10:00.

Any advice?

Thanks.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Blackjack52 on August 03, 2010, 05:24:02 PM
The way I understand the last hr to work is it shows the last whole hr from the previous hr. It's updated at :59min each hr.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: AK7V on August 04, 2010, 02:11:18 AM
On mine, the graphed data is updating every 5 minutes but the x axis labels aren't changing.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Blackjack52 on August 04, 2010, 02:38:02 PM
I see it now.

Even though the data is updated every 5min for your clientrawhour, I think the code for the x-axis is hardset to show 10-20-30-40-50-59.

I'm going to fiddle w/ the combined last hr graph's x-axis.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on August 04, 2010, 02:49:59 PM
I see it now.

Even though the data is updated every 5min for your clientrawhour, I think the code for the x-axis is hardset to show 10-20-30-40-50-59.

I'm going to fiddle w/ the combined last hr graph's x-axis.

I looked at the code and agree with your hardset conclusion, but when I look at Stuart/Broadstairs 60 min graphs they appear to show the correct minutes  :?

http://www.stella-maris.org.uk/wxgraphs.phtml
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Blackjack52 on August 04, 2010, 03:24:23 PM
Included w/ the wxgraphs are 'last 60min' (updated via clientrawextra-every 1min or so) and 'last hour' (clientrawhour updated :59min or whenever you set clientrawhour from the default). I think the time code for the 'last hour' script, 10-20-30,etc, are hard times.

The 60min graphs are temp, windspd, wind dir, and rain.
The last whole hour graphs are temp, windspd, wind dir, baro, solar, humidity, and rain.

I'm not sure what Stuart/jmcmurry others are using for x-axis time code for 60min graphs while getting temp, windspd, wind dir, baro, solar, humidity, and rain.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: AK7V on September 07, 2010, 05:00:37 PM
My 7 day graphs are always messed up.  Any ideas?

http://www.wrightwoodweather.com/wxjgraphs.php?wxj_span=week&submit=Submit

Thanks.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: blainec on November 21, 2010, 10:55:57 PM
I tried to install this, but when I browse to any of the php scripts I get the following error;

Notice: Use of undefined constant TTF_DIR - assumed 'TTF_DIR' in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Notice: Use of undefined constant home - assumed 'home' in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Warning: Division by zero in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Notice: Use of undefined constant wester54 - assumed 'wester54' in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Warning: Division by zero in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Notice: Use of undefined constant public_html - assumed 'public_html' in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Warning: Division by zero in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Notice: Use of undefined constant martindale - assumed 'martindale' in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Warning: Division by zero in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Notice: Use of undefined constant jpgraph - assumed 'jpgraph' in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Warning: Division by zero in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Notice: Use of undefined constant ttf - assumed 'ttf' in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27

Warning: Division by zero in /home/wester54/public_html/martindale/wxgraphs/jpg-config.inc.php on line 27
JpGraph Error: 25049 Font file "/usr/share/fonts/truetype/arialbd.ttf" is not readable or does not exist.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: blainec on November 22, 2010, 02:46:21 AM
OK, I seem to have got most of them working now.
The graphs that don't work are the "last 31 days" (all of them)

Is there something else I need to do to get these to work?

Title: Re: How to setup jpgraphs and wxgraphs
Post by: i_fiorentino on December 24, 2010, 01:14:46 PM
Hi guys,
i've followed the faq but i have a lot of errors: http://www.meteocarmignano.it/wxgraphs/climate-graph4.php
Here is the error smsg file: http://www.meteocarmignano.it/wxgraphs/error_msg.php
I've these settings in graphconf.php:
Code: [Select]
$hostloc = "${WEBROOT}/";
$jploc = "${WEBROOT}/jp/src/";   //must have trailing slash

and this setting:
Code: [Select]
define('TTF_DIR','/web/htdocs/www.meteocarmignano.it/home/jp/ttf/');in jpg-config.php file into jp/src folder.
I've installed jpgraph ver. 3.0.7.
Any idea?
Many thanks,

Alessandro
Title: Re: How to setup jpgraphs and wxgraphs
Post by: mava on January 02, 2011, 09:46:08 AM
Hi,
I think I have the jpgraphs up and running. But I am not able to get scripts using jpgraph to work properly.

When testing scripts in wxgraphs it seem like everything is ok. http://www.mavahome.com/wxgraphs/wxgraphs_test.html
All the other php scripts in wxgraphs is working fine.

On other scripts like Astronomy, its not working. http://www.mavahome.com/wxastro5.php
It says unable to find : /customers/mavahome.com/mavahome.com/httpd.www/jpgraph/ttf/ 
I have been in contact with the support where I have my website and they says it is the correct path.

My setting in graphconf is :

//where are your clientraw*-files and JPGraph relative to where this file is
//note you should only need to change the jpgraph directory if you do not use standard names
$hostloc = "${WEBROOT}/WD-webfiles/";                   //must have trailing slash
//$hostloc = "http://www.mavahome.com/WD-webfiles/";
$jploc = "${WEBROOT}/jpgraph/src/";   //must have trailing slash
//$jploc = "http://www.mavahome.com/jpgraph/src/";   //must have trailing slash

And the jpg-config.inc.php like this :
// UNIX:
//   CACHE_DIR /tmp/jpgraph_cache/
//   TTF_DIR   /usr/share/fonts/truetype/
//   MBTTF_DIR /usr/share/fonts/truetype/
//
// WINDOWS:
//   CACHE_DIR $SERVER_TEMP/jpgraph_cache/
//   TTF_DIR   $SERVER_SYSTEMROOT/fonts/
//   MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
//
//------------------------------------------------------------------------
// define('CACHE_DIR','/tmp/jpgraph_cache/');
define('TTF_DIR','/customers/mavahome.com/mavahome.com/httpd.www/jpgraph/ttf/');
// define('MBTTF_DIR','/usr/share/fonts/truetype/');

Any suggestions?

rgs
Magnar Vatne
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Blackjack52 on January 02, 2011, 07:31:31 PM
Hi,
It's probably a ttf error. Try posting the problems here.
http://www.weather-watch.com/smf/index.php/topic,47424.90.html (http://www.weather-watch.com/smf/index.php/topic,47424.90.html)

Problem solving errors isn't my strong point. There have been some with ttf errors when used in Europe.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on January 02, 2011, 07:53:23 PM
mava:

Your arial.ttf is here http://www.mavahome.com/jpgraph/ttf/arial.ttf

So if "customers/mavahome.com/mavahome.com" is correct I suggest you try:

define('TTF_DIR','/customers/mavahome.com/mavahome.com/jpgraph/ttf/');

or if not try

define('TTF_DIR','/customers/mavahome.com/jpgraph/ttf/');
Title: Re: How to setup jpgraphs and wxgraphs
Post by: mava on January 03, 2011, 05:54:02 AM
MadALwx : I will try there

niko :  Tested as suggested. Didn't make any difference. Still same error message.

rgs
Title: Re: How to setup jpgraphs and wxgraphs
Post by: belidi on January 31, 2011, 08:48:31 AM
Hello
I can not view the graphs, I
as "broken images" when I run the file
wxgraphs_test. However, I did install the
prog following the instructions at the beginning
this forum. Someone can come to my aid?  :(
Info:
Php 5.3.2
jpg: 3.5.0b1
$ jploc = "$ {WEBROOT} / jpgraph-3.5.0b1/src /";
hardpath: / volume1/web/jpgraph-3.5.0b1/ttf /
all in a Synology NAS (DSM 3.0)

Thank you for your help
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Blackjack52 on January 31, 2011, 02:59:10 PM
Hi,
Try changing your server side, or website jpgraph directory to "jpgraph/src".

Or make sure graphsconf.php matches your directory name for jpgraph. Both have to match.
Title: SetFillColor issue
Post by: dengland on October 10, 2011, 10:52:48 PM
Anyone else having an issue with SetFillColor being ignored for bar graphs in JpGraph Version 3.5.0b1 ?

No matter what I do I get the default blue even with a line of code like
Code: [Select]
$barplot->SetFillColor('orange@0.5');
Version 2.3.3 behaves differently (correctly) and the fill color gets honored.

Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 10, 2011, 11:01:31 PM
Anyone else having an issue with SetFillColor being ignored for bar graphs in JpGraph Version 3.5.0b1 ?

No matter what I do I get the default blue even with a line of code like
Code: [Select]
$barplot->SetFillColor('orange@0.5');
Version 2.3.3 behaves differently (correctly) and the fill color gets honored.

This version seems to be very sensitive to the order of commands, see this for the fix http://webdeveloperoddities.blogspot.com/2010/10/jpgraph-cannot-change-line-colour-or.html
Title: Re: How to setup jpgraphs and wxgraphs
Post by: dengland on October 22, 2011, 12:02:00 AM
(I swore I subscribed to this thread ... But I just saw the reply)

Worked like a Champ.  Thanks Niko. 
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 22, 2011, 12:23:04 AM
That's great! Always nice to hear back  :D
Title: Re: How to setup jpgraphs and wxgraphs
Post by: southhedland on October 29, 2011, 02:04:48 AM
Many Thanks, this is one of the easiest ive found to install and set up, Thanks Heaps

southhedlandweather.com
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 29, 2011, 02:11:11 AM
Do you have a link to your graphs?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Cavaliere89 on December 22, 2011, 03:44:12 PM
Hello to all children,

Today I tried to install these graphs using the guide made ​​the front page, following all the steps explained.

Unfortunately, however 'at the end of the installation, when I go to see an image does not appear.

Here is the referral link on my site: http://www.ombarcellonapg.tk/wdisplay/wxgraphs/rain_7days.php

http://www.ombarcellonapg.tk/wdisplay/wxgraphs/wxgraphs_test.html

Can you help?

Thanks in advance.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on December 22, 2011, 06:13:44 PM
Need to work through the error messages one by one. First please make a copy of your graphsconf.php as graphsconf.txt and post it as an attachment.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Cavaliere89 on December 22, 2011, 09:46:54 PM
Hello everyone,

http://www.ombarcellonapg.tk/wdisplay/wxgraphs/wxgraphs_test.html

I finally resolved and I can visuallizzare graphics but why some do not see it??

and then I ask how you can 'change the template of the graphs?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on December 29, 2011, 08:36:19 PM
solution found for backgrounds with jpgraph 3.5b01

http://www.weather-watch.com/smf/index.php/topic,54144.msg434870.html#msg434870

remove "required_once('jpgraph_theme.inc.php') from the jpgraph.php script and it worked (or I guess you could just comment it). This is in jpgraph version 3.5.0b1

Thanks to RonParWX
Title: Re: How to setup jpgraphs and wxgraphs
Post by: weatherforyou on January 19, 2012, 08:30:02 AM
I'm getting a message on many of my graphs "JpGraph Error : 25091 - Internal font does not support drawing text at arbitrary angle. Use TTF fonts instead."  Also all my other graphs are not using TTF.  Is there somewhere TTF needs to be turned on?  I've gone back over the instructions at least four times, and tried every combination of paths possible.

Test is at http://www.grantspassweather.com/wxgraphs/wxgraphs_test.html and hardpath at http://www.grantspassweather.com/jpgraph/ttf/hardpath.php  Path is set as
Code: [Select]
define('TTF_DIR','/big/dom/gpwx/public_html/jpgraph/ttf/');
Thanks!
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on January 19, 2012, 06:32:26 PM
try this

define('TTF_DIR','${WEBROOT}/jpgraph/ttf/');

I had a similar issue where mine was in 'blah/public_html/jpgraph/ttf/' also and it didnt work until I tried that above.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: weatherforyou on January 19, 2012, 06:58:30 PM
Thanks much for the idea.  Unfortunately didn't work in my case.   :(
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on January 19, 2012, 07:38:13 PM
Heres another idea..  move the stuff from wxgraphs to the root and try that..
Title: Re: How to setup jpgraphs and wxgraphs
Post by: weatherforyou on January 19, 2012, 08:24:31 PM
Thanks again, tman1991.  That didn't do it either, though.   :(

I did get all the graphs to display by changing $label_angle = 60 to $label_angle = 90 (thus not an arbitrary angle like it was complaining about).  But they're still not using TTF.  So I guess the problem is back in JpGraph.

I do have working graphs now.  Anymore suggestions on getting TTF to work is still appreciated.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: weatherforyou on January 19, 2012, 10:13:59 PM
Figured it out once I ran some other tests on the php installation.  Apparently FreeType wasn't enabled for some reason.  I recompiled php and all is working.  :D
Title: Re: How to setup jpgraphs and wxgraphs
Post by: bhogsett on February 29, 2012, 12:26:51 PM
I have just installed jpgraph and wxgraphs.  Easy installation and no problems--except one.

I want to use inches of mercury for the barometer setting and have these values in my graphconf.php file:

Code: [Select]
$pres_conv = 0.0295; // Set to 0.0295 for in of Mercury or 1 for hPa/mb
$pres_unit = "in"; //Set to required value

I get an error saying the minvalue I have set is larger than the max allowed value.

I suspect it should not be "in".  But I am not sure what it should be.

Oh, if I use hPa/mb I have no issues.

Bill
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on February 29, 2012, 12:44:49 PM
This is for the test graphs im assuming?    The barometeer graph has a min max setting and u need to change that after switiching units
Title: Re: How to setup jpgraphs and wxgraphs
Post by: bhogsett on February 29, 2012, 01:12:27 PM
This is for the test graphs im assuming?    The barometeer graph has a min max setting and u need to change that after switiching units

Duh!

Thanks.

Bill
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jgillett on February 29, 2012, 08:32:32 PM

define('TTF_DIR','${WEBROOT}/jpgraph/ttf/');

Had to modify that a bit for mine...

define('TTF_DIR','${WEBROOT}/jpgraph-3.5.0b1/src/fonts/');

Obviously that was because of the different structure in 3.5.0b1. It still failed. Finally took a copy of Arial from /windoze/fonts/ and dumped it into the jpgraph /fonts/. That DID work, and everything on wxgraphs_test.html finally showed up.

Thanks for the tip in the right direction.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on March 01, 2012, 01:14:50 PM
Firstly thanks to everyone in this thread for helping me to get wxgraphs up & running for inclusion in my SteelSeries Gauges.

One thing stumps me (as I am new to php) - how do I produce the drop shadow on the graphs that I see many of you have?  Mine are just flat - my test page is here: -

http://www.spireweather.co.uk/wxgraphs/wxgraphs_test.html

Also why do I some errors in place of some of my graphs?

Cheers,
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 01, 2012, 02:46:01 PM
Simon

are you running 3.5?

if so:

remove "required_once('jpgraph_theme.inc.php') from the jpgraph.php script.

Then you will get the drop shadows.

looks like your are missing the arial font or something?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on March 01, 2012, 03:20:58 PM
Thanks tman1991, that fixed it. I copied the arial & arialbd fonts to the ttf folder as requested. Is there anything else I should to to sort the problem graphs?

Many thanks for your help,
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 01, 2012, 03:25:03 PM
Did you modify the setup file for the ttf location?  read back a few posts there is some discussion on that.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on March 01, 2012, 04:17:25 PM
OK I've made those modifications to the setup & moved the arial & arialbd files to the arc/fonts directory but I still have those graph errors.

My path is now: -

define('TTF_DIR','/home/sites/spireweather.co.uk/public_html/jpgraph-3.5.0b1/src/fonts/');

See: -

http://www.spireweather.co.uk/wxgraphs/wxgraphs_test.html

Is there anything else I'm missing?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 01, 2012, 04:49:21 PM
try  define('TTF_DIR','${WEBROOT}/jpgraph-3.5.0b1/src/fonts/');

the font thing is very hit or miss.. Its very finicky to paths and I've seen a few different solutions.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on March 01, 2012, 06:13:11 PM
Same result I'm afraid  #-o

Any more suggestions? Really appreciate your help.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 01, 2012, 06:31:08 PM
you have arial.ttf in /jpgraph-3.5.0b1/src/fonts/ ?

Like I said, the font thing is very weird on this.. 

Or do you have them in ttf folder?


I have fonts in blah/src/fonts and blah/ttf  where blah is more path stuff to the jpgraph directory.

My arial is in ttf

so try
 
try  define('TTF_DIR','${WEBROOT}/jpgraph-3.5.0b1/ttf/');

or

define('TTF_DIR','/home/sites/spireweather.co.uk/public_html/jpgraph-3.5.0b1/ttf/');
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 01, 2012, 06:48:25 PM
are your fonts at least 664 on permissions? 
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 01, 2012, 06:52:40 PM
The requested URL /jpgraph-3.5.0b1/src/fonts/arial.ttf was not found on this server.

The requested URL /jpgraph-3.5.0b1/ttf/arial.ttf was not found on this server.

I think thats the problem.

where is arial.ttf?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on March 01, 2012, 06:54:54 PM
They're in both locations. Not sure what you mean by on 664 permissions?

Cheers,
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 01, 2012, 06:59:58 PM
664 is a unix number which sets permission bits.  As far as read, write, execute.  Its possible they are hidden files and not readable.

From your browser do:

http://www.spireweather.co.uk/jpgraph-3.5.0b1/src/fonts/arial.ttf

http://www.spireweather.co.uk/jpgraph-3.5.0b1/ttf/arial.ttf

does either of them work?

if you get errors and not a download prompt that means one of two things.

1) the file is NOT there
2) it is hidden, or not readable by world permissions.

Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 01, 2012, 07:02:45 PM
now that you got it working you can do cool graphs like I have in this page:

http://frogville.us/wxastronomy.php

The sunposition graph is a jpgraph..
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on March 01, 2012, 07:05:20 PM
I have been a complete idiot!   :roll:

I was using ariali.ttf - missed that extra i on the end. I obviously need an eye examination, even though I'm an optometrist!

You have been very helpful though, and very patient! Thanks.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on March 01, 2012, 07:08:07 PM
The sunposition graph is a jpgraph..

Wow that is fantastic! I won't ask how you did it ;-)

Simon
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 01, 2012, 07:10:57 PM
I didnt.. I just took about 3 different templates and combined them.    There was a wxastromony page someone else did a sunposition script and someone else had better graphics.  I just took the best of all of em and made a nice layout..  I can post my templates if you want..

Again, not my work, I just combined them all and made it xhtml compliant.

Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on March 01, 2012, 07:14:14 PM
Why not! I'd love that on my own astronomy section.

Thanks.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ThorntonWeather on March 02, 2012, 12:28:19 AM
Looking for some help with my graphs...  All was fine until I updated to the latest version.  Clearly I screwed something up in the process.  #-o

Here is the link to the test page:

http://www.thorntonweather.com/wxgraphs/wxgraphs_test.html

As you can see, the graphs don't appear.  If you open one of the images, the error message that is generated says:

Quote
Parse error: syntax error, unexpected $end, expecting '`' in /home/thornt01/public_html/wxgraphs/graphsconf.php on line 261

Attached is my graphsconf.php.  Not sure what the heck I did wrong.

Any ideas?  Thanks in advance!

   Tony

Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 02, 2012, 12:33:23 AM
look at line 27

$ysize = `92;

delete the '
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 02, 2012, 12:36:53 AM
 scroll back a few posts to find the line to delete to get the blue backgrounds to show up. 
Title: Re: How to setup jpgraphs and wxgraphs
Post by: ThorntonWeather on March 02, 2012, 12:37:51 AM
Well, crud!  Me and my fat fingers!  I went through the danged thing line by line trying to find the ' but clearly I also have malfunctioning eyes.

Thank you very much for the help!

   T
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on March 16, 2012, 10:11:59 PM
I have another question about my graphs...

Look at my test page here: -

http://www.spireweather.co.uk/wxgraphs/wxgraphs_test.html

And a friend of mine's test page here: -

http://www.bobhewitt.co.uk/pictures/WeatherDisplay/wxgraphs/wxgraphs_test.html

The second page has alternating grey bands on the y-axis of his graphs which makes them easier to read. How can this be achieved?

Cheers,
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 16, 2012, 10:29:00 PM
The Blue is what the test graphs are set to use.  The White/bands actually is an indication generally that version 3.5 of jpgraphs is being used and the line is not commented out.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on March 17, 2012, 03:04:35 PM
Thanks tmsn,

Where can I find this line to check whether or not it's commented out?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 17, 2012, 03:32:06 PM
Simon -- you have it done correctly. 

remove "required_once('jpgraph_theme.inc.php') from the jpgraph.php script.

That line conflicts with the backgrounds in jpgraphs 3.5.  The test graphs have the blue backgrounds and in order to see them, you need to comment or delete that line.  If not you get the striped white/grey look your friend has. 

Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on March 17, 2012, 06:30:15 PM
Thanks again tman,

I removed the // again from that line & indeed the graphs then displayed with the horizontal bands like my friend's, but then I lost the shadows again (I'd forgotten about our earlier conversation about this!).

So I guess there's no way no produce the shadow effect AND the horizontal stripes?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: blainec on June 17, 2012, 04:41:55 AM
Having a problem with this.  I have followed the installation instructions to the letter. I get the attached error:

http://calgary.westerncawx.net/graphspage.php
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on June 17, 2012, 07:35:28 AM
Looks like you have not created the TTF file, have you done the steps to do this as detailed on page 1 of this thread?

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: blainec on June 17, 2012, 03:29:59 PM
Yes, I have created the ttf directory and uploaded the font files as well.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on June 17, 2012, 04:00:42 PM

this is valid:  http://calgary.westerncawx.net/jpgraph-3.5/ttf/arial.ttf

so try this now:

define('TTF_DIR','${WEBROOT}/jpgraph-3.5/ttf/');

Title: Re: How to setup jpgraphs and wxgraphs
Post by: SpireWeather on June 17, 2012, 04:34:58 PM
Try placing the font file in the src/fonts directory - see the posts on the previous page (20).
Title: Re: How to setup jpgraphs and wxgraphs
Post by: blainec on June 18, 2012, 12:49:41 AM
nope, it doesn't work either
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on June 18, 2012, 01:00:39 AM
nope to which one? mine or spire suggestion
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on June 18, 2012, 02:54:17 AM
what is your TTF_DIR set to?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: blainec on June 18, 2012, 03:54:57 AM
"nope" to tman's.

The path to the ttf dir is ${WEBROOT}/jpgraph-3.5/ttf/
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on June 18, 2012, 04:11:45 AM
hmm try:

/jpgraph-3.5/ttf/

without the webroot..   Like I said in earlier posts, the TTF_DIR variable has a mind of its own half the time.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on June 18, 2012, 04:14:32 AM
also try:

/home/wester55/public_html/martindale/jpgraph-3.5/ttf/

see if that works.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: blainec on June 18, 2012, 04:16:49 AM
also try:

/home/wester55/public_html/martindale/jpgraph-3.5/ttf/

see if that works.

That is not working either

Title: Re: How to setup jpgraphs and wxgraphs
Post by: blainec on June 18, 2012, 04:58:51 AM
OK, got it now.

Thanks for all the help
Title: Re: How to setup jpgraphs and wxgraphs
Post by: PernicketyPete on October 09, 2012, 11:49:28 PM
Hi
Im trying to set up jpgraphs as described in the first post. However when I download the jpgraph file from the jpgraph site I get a file called "jpgraph-3.5.0b1.tar" this is a GZ file. Is this right ? I can't find the "jpg-config.inc.php in the jpgraph-x.xx/src folder".. What have i done wrong? Any help on this one would be great

Thanks Pete.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on October 10, 2012, 01:49:13 AM
I just downloaded the jpgraph-3.5.0b1.tar.gz file and I see jpg-config.inc.php in the /src folder. How are you extracting the files from the tar.gz archive? If you don't have a windows extract program for tar/gz I can recommend 7zip (http://www.7-zip.org/).
Title: Re: How to setup jpgraphs and wxgraphs
Post by: PernicketyPete on October 10, 2012, 09:56:19 AM
Thanks Niko
You're right. I was not unzipping the jpgraph-3.5.0b1.tar.gz file, just opening it in note pad! Just opening it in note pad, no wonder I couldn't find anything.!!
Thanks again. I will give 7zip a try later.

Pete.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: PernicketyPete on October 19, 2012, 09:58:16 PM
All up and running now :D

Thanks

Pete
Title: Re: How to setup jpgraphs and wxgraphs
Post by: plex_dk on January 06, 2013, 08:34:37 PM
Hi

I got the graphs up running, but I'm wondering why, the humidity is out of scale?

Sometimes it's like more than 100%, and then not readable on the graphs?

http://www.jasminvejr.dk/vejr/wx/wxgraphs/wxgraphs_test.html (http://www.jasminvejr.dk/vejr/wx/wxgraphs/wxgraphs_test.html)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on January 07, 2013, 12:51:58 AM
Where are your clientraw files? Have you checked the data with http://www.tnetweather.com/wd-parser.php ?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: plex_dk on January 07, 2013, 05:29:30 AM
Where are your clientraw files? Have you checked the data with http://www.tnetweather.com/wd-parser.php ?

I've checked yes, and nothing seems to be more than 100% - and it work fine with WDL.

http://www.tnetweather.com/wd-parser.php?site=http%3A%2F%2Fwww.jasminvejr.dk%2Fvejr%2Fwd&submit=Submit (http://www.tnetweather.com/wd-parser.php?site=http%3A%2F%2Fwww.jasminvejr.dk%2Fvejr%2Fwd&submit=Submit)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on January 07, 2013, 03:04:30 PM
There are a lot of 100's. (Can that be correct?)

(http://www.realweatherstation.com/FILES/hum24h.png)

And I think it's just a limitation of the graphing program that it doesn't plot a 100 line along the top of the graph. If you changed the humidity scale to 101 max I think it would plot the 100 line. I think the legend would still stop at 100 so it would still look OK.

(http://www.realweatherstation.com/FILES/hum24h2.png)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: plex_dk on January 07, 2013, 04:25:35 PM
There are a lot of 100's. (Can that be correct?)

(http://www.realweatherstation.com/FILES/hum24h.png)

And I think it's just a limitation of the graphing program that it doesn't plot a 100 line along the top of the graph. If you changed the humidity scale to 101 max I think it would plot the 100 line. I think the legend would still stop at 100 so it would still look OK.

(http://www.realweatherstation.com/FILES/hum24h2.png)

Hello Niko!

We have very wet conditions here, and I've set 97% as 100%, so that explain the 100%.

Well I'll try to find the code, and change the scale to 101%, and see how that goes - do you know where I have to look? ;)

Thank you
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on January 07, 2013, 04:52:54 PM
100% isn't too common so your 97 as 100 may be an overstatement but that's a whole other discussion  :lol:

For example in temp+hum_24hr.php, line 67

$graph->SetY2Scale("lin",0,100);

try

$graph->SetY2Scale("lin",0,101);
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on January 07, 2013, 07:58:49 PM
Forget that one. Since 100 is an artificial number I think it would be better to change all the 100's to 99's and not mess with the scale. So

After line 54

$y2data = $y;

Add:

Code: [Select]
foreach ($y2data as &$value) {
if ($value >99 )
    $value = 99;
}
Title: Re: How to setup jpgraphs and wxgraphs
Post by: nineback on January 28, 2013, 02:23:27 PM
I am using version 2.1.0 of the steelseries gauges . When I look at the wxgraphs graphsconfg.php I see the color for solar should be gold. Mine is blue. Humidity should be darkgray mine is blue. Same for humidity. I tried changing the colors in the conf file but the colors of the popup did not change.  Any ideas?

Tom
www.weather.kq5s.com (http://www.weather.kq5s.com)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: rubengt on March 01, 2013, 04:24:52 PM
Hi Guys, definitely Great software and Huge potential, I have already accomplished to get the data from our weather station online with Weather Display Live and created the Graphs with Wxgraphs, however just 2 doubts to make it Brilliant..

1- How to change the barometer scale on wxgraphs php because it is set from 940 to 1060, sometimes a 10 mb drop is barelly noticed..

2- How can I have the wind direction graphs show the wind direction average of only day time (say for example from 8 am to 10 pm) this way I could really see how is the wind behaving at the location during all day, since the night time messes up the graph with pretty much all wind directions and does not interest us.

If any help possible would be Great!
Keep up ;)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on March 02, 2013, 01:01:14 AM
How exactly do you want the baro scale to work? If you can define that we can probably show you how to implement it.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: harwx on March 13, 2013, 03:21:53 PM
Having some trouble getting graphs to work on mouseover.  I am pretty sure I have followed the instructions carefully.  If I try to open a graph in a web browser (wxgraphs/baro_1hr.php) for example, I get this error.

Parse error: syntax error, unexpected '$' in /home/content/03/10235403/html/wxgraphs/graphsconf.php on line 20

I have wxgraphs and jpgraph-3.5 in separate folders under my root.

This is from graphsconf.php:

$hostloc //$hostloc = "${WEBROOT}/";                   //must have trailing slash
= "${WEBROOT/";
$jploc = "${WEBROOT}/jpgraph-3.5/src/";   //must have trailing slash

Is my config wrong?  Something simple........again?

Stan
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on March 13, 2013, 03:57:11 PM
Unless the forum messed it up (use the # button the use a code window) that's wrong, it should be formatted like:

Code: [Select]
//$hostloc = "${WEBROOT}/";                   //must have trailing slash
$hostloc = "q:/weatherweb/";
$jploc = "${WEBROOT}/jpgraph-1.20.5/src/";   //must have trailing slash
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on March 13, 2013, 03:59:45 PM
Or maybe this if you use the default structure:

Code: [Select]
$hostloc = "${WEBROOT}/";                   //must have trailing slash
$jploc = "${WEBROOT}/jpgraph-1.20.5/src/";   //must have trailing slash
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tman1991 on March 13, 2013, 04:01:14 PM
This is what I have
Code: [Select]
$hostloc = "${WEBROOT}/";                   //must have trailing slash
//$hostloc = "./";
$jploc = "${WEBROOT}/jpgraph/src/";   //must have trailing slash
Title: Re: How to setup jpgraphs and wxgraphs
Post by: harwx on March 13, 2013, 04:13:43 PM
Thanks, got it.  This worked......after I fixed a typo #-o

Code: [Select]
$hostloc = "${WEBROOT}/";
$jploc = "${WEBROOT}/jpgraph-3.5/src/";   //must have trailing slash
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on May 15, 2013, 01:53:06 AM
I upgraded to jpgraph3.5.0b1 and none of my graphs are not showing up. Went through things and did not see anything wrong. Any help would be great.

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on May 21, 2013, 04:03:05 AM
Should have left it the way it was. Plus I should have backed up the files so I could have reverted back to them. I have looked and can not find out why the graphs are not showing up.


Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on May 27, 2013, 03:19:27 AM
I am about ready to just delete files and reupload. Can not figure out what is wrong with my jpgraphs.

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: janove on August 01, 2013, 09:33:02 PM
Hello Chuck!

Have you figured out whats wrong with your jpgraphs?

Regards
Jan-Ove

Title: Re: How to setup jpgraphs and wxgraphs
Post by: andro700 on August 01, 2013, 11:08:27 PM
I just started from the beginning and got them working.

Chuck
Title: Re: How to setup jpgraphs and wxgraphs
Post by: janove on August 01, 2013, 11:34:58 PM
Nice to hear.

Jan-Ove

Title: Re: How to setup jpgraphs and wxgraphs
Post by: mckenndk on August 18, 2013, 01:43:27 AM
I copied the test.php to the root of the web server but I just get the response 404 file or directory not found when I try and access it from the web browser.

I am running IIS 7.

Dion
Title: Re: How to setup jpgraphs and wxgraphs
Post by: mauro1108 on October 15, 2013, 08:08:01 AM
hi! i set up the wxgraphs and jpgraph in my website for using them with steelgauges; i've a strange problem; sometimes the graphs appear...sometimes they don't. I can't figure it out.....anyone can hel me?

you can se the problem at http://www.meteovidor.it/wxgraphs/wxgraphs_test.html
Title: Setup using Steel Guages, WD, jpgraphs and wxgraphs
Post by: chrisleigh on December 22, 2013, 08:51:11 PM
I followed the instructions to setup jpgraphs and wxgraphs. I dont seem to have gained the functionality.

I am using WD and Steel Guages.

When I click on the guages the graphics dont come up. Similarly the links dont work at the bottom of the page. Our page is at http://www.llsc.org.uk/gaugesnew/gauges-ss.htm

web directories attached.

What did I miss?

Any guidance greatfully received.

 
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on December 22, 2013, 08:58:24 PM
Can you post the url for one of the graphs?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: chrisleigh on December 24, 2013, 10:31:38 PM
Newbies for you hey!

In the root of the webserver I have the wxgraphs folder which had loads of php files. They seem like graph names eg wind dir 7 days
I have weather13 folder which is where the WD software points to and is attached
I have gaugesnew. Nothing there looks like graphs
I also have guages and jpgraph folder.

I think I am doing soemthing really dum here bit I cant see it.

Thanks
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on December 24, 2013, 10:51:15 PM
OK, so I found your graphs, for example http://www.llsc.org.uk/wxgraphs/baro_1hr.php but as you can see it's not working because it can't find the jpgraph files. Did you follow the instructions in the readme.txt (from the wxgraphs download) to set the paths to jpgraph and the data ?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: chrisleigh on December 24, 2013, 11:54:07 PM
Thanks for the hint. I made the mods as described in the readme.

$hostloc = "${WEBROOT}/weather13/";                   //must have trailing slash
$jploc = "${WEBROOT}/jpgraph-3.5.0b1/src/";   //must have trailing slash

So now I have the graphs working using the url. http://www.llsc.org.uk/wxgraphs/wxgraphs_test.html :-) 

Grrrrrrr....cbut I still haven't made the link from the gauges page (links at the bottom or clicking on the gauges)

I read the rest of the readme stuff again. Nothing. I'm sure I need to edit the links in a file bot cant see which.

Any ideas?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on December 25, 2013, 12:36:59 AM
OK, that's because it's expecting the graphs to be in /gaugesnew but they are in /wxgraphs so you need to fix the path. This time you need to look at the readme.txt for the gauges, I see:

If required edit the "gauges.js", the key items are at the top:
    The relative path on your website to the "realtimegauges.txt" file.
    The relative path on your website to your 'trend' graphs folder.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: chrisleigh on December 25, 2013, 06:05:45 AM
 :D You have got my graphs working !!!!!

The only thing I am shy are the links at the  bottom of the page.

eg. http://www.llsc.org.uk/gaugesnew/yesterday.htm returns an error. I have looked and cant find where yesterday.htm exists let alone where to make the directory change

This help is gratefully received.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: mcrossley on December 25, 2013, 12:32:08 PM
The links at the bottom of the page you have used are for Cumulus. Just remove them and use your normal webpage links that you use on the rest of the site. Lots of people use the Saratoga templates that separate out the navigation links. Sorry but I haven't checked your site to see which templates you ate using - too much Christmas good and drink beckoning...
Title: Re: How to setup jpgraphs and wxgraphs
Post by: rford on December 29, 2013, 05:08:15 PM
I decided to update my wxgraphs page today and so far not to good : )  http://www.mcgeescrossroadsweather.com/wxgraphs.php (http://www.mcgeescrossroadsweather.com/wxgraphs.php)  I'm receiving the following error "Parse error: syntax error, unexpected '/' in /virtual/users/e16559-17849/web/jpgraph-3.5.0b1/src/jpg-config.inc.php on line 39"  I did edit the graphsconf.php file and the jpg-config.inc.php file.  My hard path is "/virtual/users/e16559-17849/web/jpgraph-3.5.0b1/ttf/".  Could someone please give me a suggestion on what I need to do to correct my issue. 

$hostloc = "${WEBROOT}/";                   //must have trailing slash
$jploc = "${WEBROOT}/jpgraph-3.5.0b1/src/";   //must have trailing slash


// define('CACHE_DIR','/tmp/jpgraph_cache/');
   /virtual/users/e16559-17849/web/jpgraph-3.5.0b1/ttf/');
// define('MBTTF_DIR','/usr/share/fonts/TrueType/');

Thank you in advance...

Ronnie
Title: Re: How to setup jpgraphs and wxgraphs
Post by: rford on December 29, 2013, 09:34:58 PM
I went back and checked my work again...currently I'm receiving this error:  Parse error: syntax error, unexpected '$SERVER_SYSTEMROOT' (T_VARIABLE) in /virtual/users/e16559-17849/web/jpgraph-3.5.0b1/src/jpg-config.inc.php on line 34

//------------------------------------------------------------------------
// define('CACHE_DIR','/tmp/jpgraph_cache/');
   define('TTF_DIR','/virtual/users/e16559-17849/web/jpgraph-3.5.0b1/ttf/');
// define('MBTTF_DIR','/usr/share/fonts/TrueType/');

//-------------------------------------------------------------------------

$hostloc = "${WEBROOT}/";                   //must have trailing slash
$jploc = "${WEBROOT}/jpgraph-3.5.0b1/src/";   //must have trailing slash

http://www.mcgeescrossroadsweather.com/wxgraphs.php (http://www.mcgeescrossroadsweather.com/wxgraphs.php)

Ronnie
Title: Re: How to setup jpgraphs and wxgraphs
Post by: MichaelPT on July 27, 2015, 10:31:48 PM
Hi everybody

I'm trying to set up  jpgraphs and wxgraphs

I'm getting a problem with fonts

http://www.weather-above.com/wxgraphs/wxgraphs_test.html

Trying to get the graphs set up for steelGauges

http://www.weather-above.com/steelGauge.html

Appreciate any help is my dyslexia is starting to get the better of me

Thank you
Title: Re: How to setup jpgraphs and wxgraphs
Post by: wvdkuil on July 29, 2015, 12:28:28 PM
Hi everybody

I'm trying to set up  jpgraphs and wxgraphs

I'm getting a problem with fonts

http://www.weather-above.com/wxgraphs/wxgraphs_test.html

Trying to get the graphs set up for steelGauges

http://www.weather-above.com/steelGauge.html

Appreciate any help is my dyslexia is starting to get the better of me

Thank you
The font the scripts are looking for is  arialbd.ttf as you can see in the error messages.

That font is not in your fonts folder, but there is a ARIALBD.ttf
You should copy that font and name  it  arialbd.ttf
You can not simply rename it as 1 of the graphs work OK.

===
If that does not work, you have check the path in   jpgraph/src/jpg-config.php
Try
Code: [Select]
define('TTF_DIR', "../fonts/ttf/");
Succes, Wim


Title: Re: How to setup jpgraphs and wxgraphs
Post by: hydrowx on January 17, 2016, 04:15:16 PM
I setup wxgraphs on my web site some 8+(?) years ago  8O or so and all has been working fine until this week. My guess is a php update or such on my web host has resulted in issues. My graphs no longer work and I get an error about the strfttime() being used.

I thought it may be best to update everything but not exactly sure where to start. I'm guessing download and install latest jpgraph but have there been updates to the wxgraphs php scripts themselves? Is there a better alternative I can look into? With a long weekend and current wind chills between -10 and -20F I have some time to sort this out.

Thanks
Bill
Title: Re: How to setup jpgraphs and wxgraphs
Post by: R_o_B on January 18, 2016, 02:14:30 PM
Bill, how familiar (knowledgeable) are you with PHP?

Oh, also be advised that PHP 7 has officially been released ... and that PHP 5.6 will only be supported until December 2016.

The 'JpGraph (http://jpgraph.net/)' scripts are 5+ years old - they have not been updated since October 2010.

You might be interested in looking at the more modern and regularly updated 'Highcharts (http://www.highcharts.com/)' - there will be a 'learning curve' but it will be well worth your time - once you understand how to produce one of the charts you will want to convert all your website charts to the Highcharts...  :wink:
Title: Re: How to setup jpgraphs and wxgraphs
Post by: hydrowx on January 18, 2016, 07:29:00 PM
Thanks Ray. I'm just a little familiar with php, enough to be dangerous I guess.  :?  I'll look into those Highcharts, I've seen them on various other web sites and they do look nice.

PS...got the same php time error when I tried to view your station graphs.

Bill
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on January 18, 2016, 07:38:57 PM
What version jpgraph are you running?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: hydrowx on January 18, 2016, 07:47:18 PM
What version jpgraph are you running?

The stone age one...1.21. Wondering if just updating the version of jpgraphs will solve my problem?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on January 18, 2016, 08:17:11 PM
I have a test page (http://realweatherstation.com/wxg/year_rain.php) working OK on jp 3.5 so give it a try, as I recall I had to make a small change to 3.5 to get the "old" format.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: R_o_B on January 19, 2016, 01:38:22 PM
PS...got the same php time error when I tried to view your station graphs.
Bill, unfortunately, the pages you saw (when you clicked on my link) are way outdated ... like really really outdated...  :oops:

I have been working on some new and much more modern templates but I have not put them online yet ... I keep pushing the date/year for the release of the new pages...  :roll:
Title: Re: How to setup jpgraphs and wxgraphs
Post by: hydrowx on January 19, 2016, 11:29:36 PM
 
Quote
keep pushing the date/year for the release of the new pages...  :roll:

Understand completely. I have a list of things I need to update but other things get in the way. :?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: R_o_B on January 20, 2016, 11:09:24 AM
Bill, as you noticed on my site, the JpGraph do not seem to work well (or at all) with PHP 7... :oops:
Title: Re: How to setup jpgraphs and wxgraphs
Post by: hydrowx on January 20, 2016, 10:44:04 PM
Well, all of a sudden my graphs are working again with no changes on my part. Go figure.  :scratch: Perhaps a setting on the server at my web host was changed?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: gustaf67 on January 31, 2016, 03:50:16 PM
What is wrong with me? What is it that I am doing wrong?
I can not see what is wrong

I have tried to follwo Tim Hankos guide.

I got the test.php and it replies that I have PHP 5.6.17 and GD support enabled

I got the jpgraph-3.5.0b1.tar
(I can not find the version 2.2 that Tim is pointing to)
Location for jpgraph is: /usr/local/www/apache24/data/jpgraph-3.5.0b1/

Broadstaris wxgraphs is in place: /usr/local/www/apache24/data/wxgraphs/

Did I get the graphsconf.php correct ?

//where are your clientraw*-files and JPGraph relative to where this file is^M
//note you should only need to change the jpgraph directory if you do not use standard names^M
//$hostloc = "${WEBROOT}/";                   //must have trailing slash^M
$hostloc = "/usr/local/www/apache24/data/weather/weatherdata/";^M
$jploc = "/usr/local/www/apache24/data/jpgraph-3.5.0b1/";   //must have trailing slash^M
^M
//Set this variable to either 12 or 24 depending on whether you run Weather Display in 12  or 24 hour mode^M
$hourmode = "24";^M


When I run the hardpath.php I get: /usr/local/www/apache24/data/jpgraph-3.5.0b1/ttf/ in my browser

Then I have edit the  jpg-config.inc.php and added the path
/usr/local/www/apache24/data/jpgraph-3.5.0b1/ttf/

Uploaded the fonts to the ttf folder

The server says that it is unable to locate the JPGraph files when I try to get the rain_1hr.php

 
I run WDL 10.37R Build 81 on Win Xp and the files a uploaded to Freebsd 10.1

Please, command me dark lords.....
 :D
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on January 31, 2016, 03:58:23 PM
What is the full url are you using for rain_1hr.php?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: gustaf67 on January 31, 2016, 06:20:09 PM
What is the full url are you using for rain_1hr.php?

I use the LAN.....
http://192.168.100.100/wxgraphs/rain_1hr.php

And I have tried the FQDN too
http://www.schultze.nu/wxgraphs/rain_1hr.php


Title: Re: How to setup jpgraphs and wxgraphs
Post by: gustaf67 on February 02, 2016, 02:38:14 PM
I think I got it to work.
I removed it all and started all over and this time unpack the tar files on the server. I also change the foder to just jpgraph instead of jpgraph-3.5.0b1

http://www.schultze.nu/wxgraphs/wxgraphs_test.html
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Freestyle on February 08, 2016, 04:28:23 PM
Found a small issue with wxgraphs (really a bug/issue with IIS).
I am using an IIS 7.5 server and apparently it does not like files names with a "+" symbol in them. They result in a 404 error.
So the following files do not work:
temp+dew+hum_1hr.php
temp+dew+hum_24hr.php
temp+hum_24hr.php
I noticed it in the Steel Gauges part of  the Leuven-Template.
Changing the "+" symbol to a "_" and changing all references to those files makes everything work properly.
So anyone running an IIS server with php may also need to do the same.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: MegaMax on May 14, 2016, 03:18:33 PM
I know this is an old post but I've been wanting to do something like this. Is this script still functional? If so on step 6, do I put the folder in the JGraphic folder of below it on the server? I'd appreciate any help.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on May 14, 2016, 05:49:54 PM
Unless your server is already running php version 7 it should be fine.

6. Create a new folder under jpgraph-x.xx called ttf.

/jpgraph-1.22/ttf/  (the numbers will be different for your version of jpgraph - I hope)

IOW you create the new ttf folder in your jpgraph-[version] folder.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Weather Display on May 14, 2016, 09:18:35 PM
Quote
MegaMax
 
Posts: 1
Future meterologist/storm chaser.

good to see a young weather enthusiast, welcome :)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: MegaMax on May 14, 2016, 10:19:49 PM
Thank you to both of you.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Mat Mackenzie on August 19, 2016, 05:04:24 PM
I see this is a very old thread, but I'm following the instructions nonetheless to install.

I've tried everything I can think of but getting a repetitive error:

Strict Standards: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /homepages/44/d119568937/htdocs/website/weather/jpgraph-4.0.1/src/jpgraph.php on line 395

e.g. http://www.hssc.net/weather/wxgraphs/windgust_1hr.php

And here are my PHP settings:

http://www.hssc.net/test.php
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on August 19, 2016, 06:31:43 PM
The warning is telling you to add a time zone setting line, like this:

Code: [Select]
date_default_timezone_set('Europe/London');
Title: Re: How to setup jpgraphs and wxgraphs
Post by: R_o_B on August 20, 2016, 01:33:56 PM
Be advised that a new version of JpGraph was released a few days ago (2016-08-09) - version 4.0.1 of JpGraph supports PHP5 (PHP 5.1.0 or higher version) and PHP 7.0.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on August 20, 2016, 02:02:29 PM
Thanks R_o_b, good to know  :)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Mat Mackenzie on August 21, 2016, 05:45:44 PM
Hey - great - thanks - I've only gone and got it working!!  :D

http://www.hssc.net/weather/gauges.htm
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 17, 2016, 06:21:26 PM
Hi guys!

Yet another newbie with jpg-config.inc.php problems ...

* Hardpath is /customers/7/d/e/gudmundsbyn.se/httpd.www/jpgraph/truetype/    http://gudmundsbyn.se/jpgraph/truetype/hardpath.php

* http://gudmundsbyn.se/jpgraph/truetype/arial.ttf and http://gudmundsbyn.se/jpgraph/truetype/arialbd.ttf exists and are readable.

I have tried http://gudmundsbyn.se/jpgraph/src/Examples/testsuit.php with:

define('TTF_DIR','/jpgraph/truetype/');
define('TTF_DIR','/customers/7/d/e/gudmundsbyn.se/httpd.www/jpgraph/truetype/');
define('TTF_DIR','${WEBROOT}/jpgraph/truetype/');

with no luck :/ fonts are not working.

I hope one of you spots my mistake or has a good idea re what I can try to fix this ...

Thanks in advance /JensB



Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on September 17, 2016, 07:30:23 PM
Try

define('TTF_DIR','../../truetype/');

or

define('TTF_DIR','../truetype/');
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 17, 2016, 09:49:16 PM
Try

define('TTF_DIR','../../truetype/');

or

define('TTF_DIR','../truetype/');

Hi! Thnx for helping a n00b :)

Tried both, no luck

(http://i.imgur.com/p3NehOs.png)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on September 17, 2016, 11:17:37 PM
What version of jpgraph?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 17, 2016, 11:55:30 PM
What version of jpgraph?

Version: 4.0.1 (2016-08-09) jpgraph-4.0.1.tar.gz
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on September 18, 2016, 12:11:31 AM
I've never ventured past 3.5, I'll have to look at that one.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on September 18, 2016, 12:49:46 AM
Please attach a copy of your jpg-config.inc.php saved as jpg-config.inc.php.txt

I set up what I think is the same directory structure and

Code: [Select]
define('TTF_DIR','../../truetype/');
works for me :dontknow:
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 18, 2016, 04:26:00 PM
so many weird things ... sigh

1. when unpacking jpgraph-4.0.1.tar.gz with winrar on win7 I have to run winrar in Admin mode .. because some file in the tar is seen as a symlink by windows. This results in the whole tar being unpacked again in jpgraph\src\Examples over and over.
Seems like the culprit is jpgraph a zero byte file in /Examples/

2. Deleted everything and started over now almost nothing works :) http://www.gudmundsbyn.se/jpgraph4/src/Examples/testsuit.php

3. Only thing I have changed in jpg-config.inc.php is the define('TTF_DIR','${WEBROOT}/jpgraph4/truetype/');


4. Also found out that I cant use a ttf folder .... web hotel wont let me read it :)

Would you have an older jpgraphs you could attach? So I can be sure the tar isn't the problem.

Thanks for all the help /JensB
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on September 18, 2016, 04:56:33 PM
I used 7zip (http://www.7-zip.org/) to unpack it, had no issues.

In my experience you have to work through this step by step...

First, change the foldername from jpgraph4 to jpgraph, jpgraph4 may cause some confusion and we have enough already  :lol:

Next, start with http://www.gudmundsbyn.se/jpgraph4/src/Examples/accbarex1.php change these two lines:

Code: [Select]
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_bar.php');

to

require_once ('../jpgraph.php');
require_once ('../jpgraph_bar.php');

and see if that graph works.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 18, 2016, 06:51:41 PM
http://www.gudmundsbyn.se/jpgraph/src/Examples/accbarex1.php

nope not working

Code: [Select]
<?php // content="text/plain; charset=utf-8"
require_once ('../jpgraph.php');
require_once (
'../jpgraph_bar.php');

$datay1=array(13,8,19,7,17,6);
$datay2=array(4,5,2,7,5,25);

// Create the graph.
$graph = new Graph(350,250);
$graph->SetScale('textlin');
$graph->SetMarginColor('white');

// Setup title
$graph->title->Set('Acc bar with gradient');

// Create the first bar
$bplot = new BarPlot($datay1);
$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT);
$bplot->SetColor('darkred');

// Create the second bar
$bplot2 = new BarPlot($datay2);
$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT);
$bplot2->SetColor('darkgreen');

// And join them in an accumulated bar
$accbplot = new AccBarPlot(array($bplot,$bplot2));
$graph->Add($accbplot);

$graph->Stroke();
?>

Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 18, 2016, 06:59:43 PM
same error when unpacking with 7zip 64bit   (tkomst nekad is Swedish for Access Denied)

(http://i.imgur.com/QnOJupp.jpg)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 18, 2016, 07:04:06 PM
something is wrong with permissions maybe?

hardpath.php works in http://www.gudmundsbyn.se/jpgraph/truetype/hardpath.php

but not in http://gudmundsbyn.se/jpgraph/src/Examples/hardpath.php

I dont have shell access though, only ftp
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on September 18, 2016, 07:22:14 PM
I'm sorry, there's something very wrong with all this and I don't think I can be much help  :(
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 18, 2016, 07:33:43 PM
Well I am very happy with the advise you have been giving me! :)

Im too tired now myself :) so Ill delete jpgraph locally and on ftpserver  and then Ill start over tomorrow.

If (when) I get it up and running Ill do a post here, so we both know if someone else has the same problem :)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on September 18, 2016, 08:00:03 PM
Check your PM for something that may help  :)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 18, 2016, 08:24:58 PM
 :multi:
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 21, 2016, 02:30:38 PM
Hi again!

Solved 2 problems :)

1. I had to CHMOD /jpgraph/ and subfolders to be able to execute PHP in them. I just set them to 777

2. hardpath.php does not give my accounts real php path, I needed to login in to admin panel at the web hotel to find the path.

With the correct path in both scripts WX Graphs test works fine http://www.gudmundsbyn.se/wxgraphs/wxgraphs_test.html


But still empty popups in Steelseries http://www.gudmundsbyn.se/vader/steelseries/gauges-ss-basic.htm

First I thought that I have to define /wxgraphs/ in gauges.js or gauges-ss-basic.htm but I cant find any such setting ...

So once again Im forced to bother you guys :/




Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on September 21, 2016, 02:49:18 PM
The graph location is defined in gauges.js:

            imgPathURL        : './images/',

Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 21, 2016, 03:18:17 PM
The graph location is defined in gauges.js:

            imgPathURL        : './images/',

sigh ... I searched for wxgraphs and a setting for location :)

should this point to /wxgraphs/ ? ie imgPathURL         : '/customers/7/d/e/gudmundsbyn.se//httpd.www/wxgraphs/',

and should I leave oldGauges as it is (since I dont have any)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on September 21, 2016, 04:02:34 PM
It wants a relative path, I think that would be:

Code: [Select]
'../../wxgraphs/'
I don't know what old gauges is, maybe a link to WDL ? I doubt it will break anything.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: jensb on September 21, 2016, 04:14:07 PM
It wants a relative path, I think that would be:

Code: [Select]
'../../wxgraphs/'
I don't know what old gauges is, maybe a link to WDL ? I doubt it will break anything.

"It's Alive!!!"

http://www.gudmundsbyn.se/vader/steelseries/gauges-ss-basic.htm

Thanks for all the help & patience with a PHP n00b :)

Expect huge transfer of Karma points to your account ;)
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on September 21, 2016, 04:18:49 PM
Looking good  :D
Title: Re: How to setup jpgraphs and wxgraphs
Post by: tronsdal on July 16, 2017, 08:33:39 PM
Hi

I have a strange problem.

The Steel gauges looks allright with the graphs from wxgraphs in IE11 and MS Edge. But when browsing with Chrome or Safari, the graphs are not shown, and gauges disabled (marked false in gauges.js) are also displayed in Chrome and Safari. It seems like gauges.js is not read competely in Chrome and Safari.

See http://ovlinglia.com/wgauges/web_server/gauges-ss.htm
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on July 16, 2017, 08:47:59 PM
I don't see those problems, your gauges and graphs are working OK for me in Chrome.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: mcrossley on July 17, 2017, 09:56:52 AM
Have you tried clearing the browser cache in Chrome and Safari?
Title: Re: How to setup jpgraphs and wxgraphs
Post by: Nickji on September 20, 2017, 03:29:10 PM
Managed to get it set up, but curiously all the graphs on the test page appear to be using the default font apart from the Snow graph, which appears to be using arial.  Any ideas?
http://www.costa-mogan.com/weather/wxgraphs/wxgraphs_test.html
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on September 20, 2017, 08:22:13 PM
This was an error on my part. I will take a close look at the snow.php file and provide a modified version in a day or so. It's easy to forget when changing so many files.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on September 21, 2017, 07:21:11 AM
The corrected version of the snow.php graph script is shown here simply copy and paste this into the snow.php file you have now and it should obey the font settings in the config file.

Code: [Select]
<?php
// Graphs Package V3.0 21st November 2016
if (!file_exists("graphsconf.php")) include("error_msg.php");
include (
"graphsconf.php");
if (!
file_exists($jploc."jpgraph.php")) {
  
$string "Unable to find JPGraph files";
  
create_image1($string,$jploc);
  exit;
}
include (
$jploc."jpgraph.php");
include (
$jploc."jpgraph_bar.php");

$clientrawextra get_raw ("${hostloc}clientrawextra.txt");//for this graph we only need the values from this file

// Here we create an array of the values we need depending of the month we are in (each month we shift to the left 1 place)
$x=array();
$y=array();

$y=array($clientrawextra['479'],$clientrawextra['480'],$clientrawextra['481'],$clientrawextra['697']);

$datay $y;

if (
$snow_conv != 1) {
array_walk($datay"SMtoI");
}

//With this-one we calculate the labels for the x-axis
$curmth date("n");

$x = array($txt_today,$month_array[$curmth],$txt_season,$txt_depth);

// Create the graph. These two calls are always required
$graph = new Graph($xsize,$ysize,"auto",60);
$graph->SetScale("textlin");

//Setup margin color
$graph->SetMarginColor("$margincolour");

//Here we set a dropshadow around the graph
$graph->SetShadow();

// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(30,30,30,40);

// Create a bar pot
$bplot = new BarPlot($datay);

//Setup width of bars
$bplot->SetWidth(0.7);

// Setup color for gradient fill style 
$bplot->SetFillGradient("$snow_col","#EEEEEE",GRAD_LEFT_REFLECTION);

// Use 10% "grace" to get slightly larger scale then max of
// data or the value of max will end up in the title area
// you can commend this out if you dont show the values themselves
$graph->yscale->SetGrace(10);

// Create a line plot
$bplot = new BarPlot($datay);
$graph->Add($bplot);

$bplot->SetWeight(2);
$bplot->SetColor("$snow_col");
$bplot->SetFillGradient("$snow_col","#EEEEEE",GRAD_LEFT_REFLECTION);
if  (
$bar_snow == 1) {
    
$bplot->SetValuePos($bar_pos);
    
$bplot->value->Show();
    
$bplot->value->SetAngle($bar_angle);
    
$bplot->value->HideZero();
    
$bplot->value->SetColor($barTXT_col);
    
$bplot->value->SetFormat("$snow_format");
    eval (
$bset);
//    $bplot->value->SetFont(FF_FONT0,FS_BOLD,6);
    
eval ($bsetv);
    }

// Setup the titles
eval ($tset);
$graph->title->Set("$txt_snow ($snow_unit)");
$graph->title->SetColor("$textcolour");

//x-axis
eval ($xtset);
eval (
$xset);
$graph->xaxis->SetTickLabels($x); 
$graph->xaxis->SetTextLabelInterval(1);
$graph->xaxis->SetPos("min");
//$graph->xaxis->SetFont(FF_FONT0,FS_BOLD,8); 
$graph->xgrid->Show(true);
$graph->xaxis->SetColor("$xtextcolour"); 
$graph->xaxis->SetTickLabels($x);

//y-axis
eval ($yset);
//$graph->title->SetFont(FF_FONT0,FS_BOLD,10);
//$graph->yaxis->SetFont(FF_FONT0,FS_BOLD,8);
$graph->yaxis->SetColor("$ytextcolour");
$graph->yaxis->HideTicks(true,true); 

// Display the graph
$graph->Stroke();
?>


Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on September 21, 2017, 08:26:00 AM
I have updated my wxgraphs.zip file to contain the new version of snow.php, so any new downloads will get the updated file.

Stuart
Title: Re: How to setup jpgraphs and wxgraphs
Post by: dsscheibe on January 01, 2019, 01:24:58 AM
https://weather.scottsworld.info/wxgraphs/wxgraphs.html (https://weather.scottsworld.info/wxgraphs/wxgraphs.html)


Up and running, but all the values are metric except wind which is in MPH.  I know nothing about php, I can code html and css.

Two of the solar files (https://weather.scottsworld.info/wxgraphs/solar_1hr.php) generate this error.  Would it ber possible to have the same UV files as the solar.


The error log showed it did not like UTC-7 for timezone but gave the error with a date America/Denver   so I tried America/Phoenix but it did not seem to understand that so I changed it back to Denver which Phoenix is MST time but does not follow  daylight savings.

Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on January 01, 2019, 02:11:12 AM
#1 Fix the solar errors  by getting the arialbd.ttf file into the location in the error message. That file should be found in the jpgraph download but is maybe in a different folder, or I'm sure there is one on your PC that you can use.

#2 All the units are set in the graphsconf.php file starting around line 80. Open it in any plain text editor, it is well commented, you should have no trouble finding and setting the units.

#3 Arizona time zone is problematic, I need to research that some more.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: dsscheibe on January 01, 2019, 02:48:09 AM
After skimming though other messages I looked farther into the config file and got the units changed.  Will try the fonts tomorrow, the tv is my monitor for the weather station..   Any hints on getting  ../gauges-ss-basic-inc.php   working?  I had SS guages working, then WD crashed and I could not get it to work any more.  linking php files
Code: [Select]
<img src="baro_1hr.php" was something I did not know until I looked at the test page.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: saratogaWX on January 01, 2019, 03:18:07 AM
WD doesn't provide separate graphs -- the JPGraph set of scripts are used to display the mouse-over graphs when Weather-Display is used.

Title: Re: How to setup jpgraphs and wxgraphs
Post by: dsscheibe on January 02, 2019, 04:03:07 AM
#1 Fix the solar errors  by getting the arialbd.ttf file into the location in the error message. That file should be found in the jpgraph download but is


Could not figure out where it was looking for the Ariel Bold fonts. I searched for ttf and they are all over the computer. I opened the solar files and compared the working files to the non working ones.  The difference is the working ones have the fonts are // commented out and the non working ones were not. So I edited the non working ones adding // before the fonts and that seems to have fixed it. Though one of the 4 have disapeared.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: s52sk on January 11, 2019, 12:24:10 PM
Hi!
I just made graphs on gauges with great help on the first page of this topic. Everythng works fine. Just looking forward to translate graph to Slovenian language.
Thanks guy,s

Here the graphs: http://www.s52sk.com/wmr200/wx.html

Marco
Title: Re: How to setup jpgraphs and wxgraphs
Post by: youngros on March 24, 2019, 04:04:16 PM
After changing to a new host, I found my jpgraphs stopped working. So I downloaded the latest version of jpgraphs and wxgraphs and it is still not working. Really messed something up here.
https://mad-weather.com/wxgraphs/wxgraphs_test.html right click to view an image and you get the following error Chosen locale file ("lang/en.inc.php") for error messages does not exist or is not readable for the PHP process. Please make sure that the file exists and that the file permissions are such that the PHP process is allowed to read this file.
But the file is there, so very confused about that.
Error log for wxgraphs gives hundreds of the following type message PHP Warning:  imageloadfont(/home/madweather/public_html/jpgraph-4.2.6/src/fonts/FF_FONT0.gdf): failed to open stream: No such file or directory in /home/madweather/public_html/jpgraph-4.2.6/src/gd_image.inc.php on line 92
Those fonts are there from what I can see.
Any help on this would be much appreciated, thank you.
Rosalind
Edited: Played around with this. Renamed the folder to just jpgraph. I now don't get any errors but just a black page. In Firefox it does say that the image cannot be displayed because it contains errors. Grrrr.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: youngros on March 25, 2019, 10:37:24 AM
I found an older 3.5 version of jpgraphs to try that and see if it works and I still get the same result. The newest version does not have the src folder, but that shouldn't make a difference. I get the image cannot be displayed because it contains errors, but I don't know what the errors are.
The only difference with the hosting is that I am using Litespeed but it is the same php version as previously used and GD is enabled.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: broadstairs on March 25, 2019, 04:43:24 PM
I just downloaded the free version of JPGraphs 4.2.6 and it does indeed have an src folder. If yours is missing then something is wrong. If the src folder is missing they graphs will NOT work. Dont know anything about Litespeed web server so cannot help there.

Stuart

Edit: I just tested my install with 4.2.6 using Apache and it works fine.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: niko on March 25, 2019, 04:56:45 PM
I have run my site on Litespeed, it will not be a problem.
Title: Re: How to setup jpgraphs and wxgraphs
Post by: youngros on March 26, 2019, 04:11:52 PM
The first jpgraph did not unzip properly so did it again and got the src folder. I had the contents of the src folder which is why I didn't initially work out it wasn't right.

Anyway, it didn't make any difference they still don't work.

I did new uploads of both jpgraph and wxgraphs. Edited the graphsconf.php to point to jpgraph, but then I get the same result.

Have also set the path for ttf files.

I also tried setting a hardpath for the WEBROOT and nada.

Flummoxed!
Title: Re: How to setup jpgraphs and wxgraphs
Post by: youngros on March 26, 2019, 07:22:20 PM
Think I have solved it. I hunted around on the internet for the error and it suggested a blank space in the code.
When I try and edit via my ftp program, for some reason it adds an extra line to the code, no idea why it does this. So edited via a very old Dreamweaver and it doesn't add the extra lines and so far the test page is working.
Hope this might help someone else.
Rosalind