Weather-Watch.com
September 02, 2010, 05:29:48 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Members: 8,509  Posts: 362,030  Topics: 40,113
Please welcome lawrencerebeiro, our newest member.

Latest versions: WD - 10.37P  WDL - 6.05  MML - 1.03
 News:
Check out the new FAQs (Frequently Asked Questions) board for a growing list of hints, tips and diagnostic suggestions.
  Advanced Search
   Home   Bug Tracker Photo Gallery Wiki Chat Calendar Search Login Register Help  
Pages: [1] 2 3 ... 17
  Print  |  « previous  |  next »  |  Go Down  
Author Topic: How to setup jpgraphs and wxgraphs  (Read 55621 times)
0 Members and 1 Guest are viewing this topic.
Tim Hanko
Rain Maker
***
Offline Offline

Location: Grand Rapids, Michigan, USA
Station Type: Davis Vantage Pro II, Boltek StormTracker
Posts: 1,087
Local Time: Thursday 12:29



WWW
« on: November 02, 2007, 02: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 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 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 and 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

Any comments, changes or suggestions are welcomed.

* files.zip (0.26 KB - downloaded 675 times.)
« Last Edit: January 04, 2008, 02:10:40 AM by Tim Hanko » Logged
broadstairs
Stuart
Weather Controller
*****
Offline Offline

Location: Broadstairs, Kent, UK
Station Type: Davis VP1 wireless with Davis Solar sensor
Posts: 5,549
Local Time: Thursday 18:29



WWW
« Reply #1 on: November 02, 2007, 08:54:52 AM »

Well done Tim, I was about to do something similar but you beat me to it.

Stuart
Logged

daveq
Junior Weather Controller
****
Offline Offline

Location: Hollywood, MD
Station Type: Davis VP2 w/FARS
Posts: 3,097
Local Time: Thursday 13:29



WWW
« Reply #2 on: November 02, 2007, 11:56:12 AM »

Looks like a FAQ that would be helpful.  Maybe someone could make it one.

--Dave
Logged
niko
syzygy
Junior Climate Controller
**
Offline Offline

Location: Northern California, U.S.A.
Station Type: 2 x Davis VP2 Wireless / Win 2000
Posts: 18,782
Local Time: Thursday 11:29


Crystal Ball broken! Please post the URL.


WWW
« Reply #3 on: November 02, 2007, 12: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.
Logged

niko
syzygy
Junior Climate Controller
**
Offline Offline

Location: Northern California, U.S.A.
Station Type: 2 x Davis VP2 Wireless / Win 2000
Posts: 18,782
Local Time: Thursday 11:29


Crystal Ball broken! Please post the URL.


WWW
« Reply #4 on: November 02, 2007, 12: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.
Logged

Tim Hanko
Rain Maker
***
Offline Offline

Location: Grand Rapids, Michigan, USA
Station Type: Davis Vantage Pro II, Boltek StormTracker
Posts: 1,087
Local Time: Thursday 12:29



WWW
« Reply #5 on: November 02, 2007, 12: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.
Logged
Tim Hanko
Rain Maker
***
Offline Offline

Location: Grand Rapids, Michigan, USA
Station Type: Davis Vantage Pro II, Boltek StormTracker
Posts: 1,087
Local Time: Thursday 12:29



WWW
« Reply #6 on: November 03, 2007, 11:27:15 AM »

Niko,

I just noticed that you use in your avatar one of the coolest words in the English language.  Very Happy
Logged
niko
syzygy
Junior Climate Controller
**
Offline Offline

Location: Northern California, U.S.A.
Station Type: 2 x Davis VP2 Wireless / Win 2000
Posts: 18,782
Local Time: Thursday 11:29


Crystal Ball broken! Please post the URL.


WWW
« Reply #7 on: November 03, 2007, 01:11:58 PM »

Thanks for noticing  Laughing
Logged

kewee
Junior Forecaster
****
Offline Offline

Posts: 69
Local Time: Thursday 17:29


« Reply #8 on: January 04, 2008, 01: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 d'oh!
Logged
Tim Hanko
Rain Maker
***
Offline Offline

Location: Grand Rapids, Michigan, USA
Station Type: Davis Vantage Pro II, Boltek StormTracker
Posts: 1,087
Local Time: Thursday 12:29



WWW
« Reply #9 on: January 04, 2008, 02:04:29 AM »

You need to download wxgraphs from here:

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

Probably should add that to the directions...
Logged
kewee
Junior Forecaster
****
Offline Offline

Posts: 69
Local Time: Thursday 17:29


« Reply #10 on: January 05, 2008, 01:02:55 AM »

Tim.

Thank you so much....

Rick
Logged
kewee
Junior Forecaster
****
Offline Offline

Posts: 69
Local Time: Thursday 17:29


« Reply #11 on: January 05, 2008, 01: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
Logged
Tim Hanko
Rain Maker
***
Offline Offline

Location: Grand Rapids, Michigan, USA
Station Type: Davis Vantage Pro II, Boltek StormTracker
Posts: 1,087
Local Time: Thursday 12:29



WWW
« Reply #12 on: January 05, 2008, 01:41:56 AM »

Kewee,

Remove the . before WEBROOT in both lines.
Logged
kewee
Junior Forecaster
****
Offline Offline

Posts: 69
Local Time: Thursday 17:29


« Reply #13 on: January 05, 2008, 02: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
Logged
dafuser
Weather Guru
**
Offline Offline

Location: Granbury, Texas
Station Type: Davis Vantage Vue
Posts: 529
Local Time: Thursday 21:29



WWW
« Reply #14 on: January 05, 2008, 04: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


Logged

--
Thanks Les...
Microsoft Windows: Proof that P.T. Barnum was correct.

24 inch iMac 2.8GHz C2D, 4 GB Ram (OS X 10.6.3 Snow Leopard) Davis Vantage Vue
Pages: [1] 2 3 ... 17
  Print  |  « previous  |  next »  |  Go Up  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!