cloudy cloudy

Author Topic: How to setup jpgraphs and wxgraphs  (Read 190238 times)

0 Members and 1 Guest are viewing this topic.

Offline Tim Hanko

  • Posts: 1,108
  • Grand Rapids, Michigan, USA
    • Walker, MI Weather
Re: How to setup jpgraphs and wxgraphs
« Reply #15 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.

Offline kewee

  • Posts: 71
Re: How to setup jpgraphs and wxgraphs
« Reply #16 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

Offline dafuser

  • Posts: 571
  • Granbury, Texas
    • Weather from the shores of Lake Granbury
Re: How to setup jpgraphs and wxgraphs
« Reply #17 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
--
Thanks Les  de NA5AA

Microsoft Windows: Proof that P.T. Barnum was correct.

24 inch iMac 2.8GHz, 4 GB Ram (OS X 10.8.3 Mountain Lion) Davis Vantage Vue

Offline Tim Hanko

  • Posts: 1,108
  • Grand Rapids, Michigan, USA
    • Walker, MI Weather
Re: How to setup jpgraphs and wxgraphs
« Reply #18 on: January 05, 2008, 06:14:07 PM »
Could you both post the results of running hardpath.php?

Offline dafuser

  • Posts: 571
  • Granbury, Texas
    • Weather from the shores of Lake Granbury
Re: How to setup jpgraphs and wxgraphs
« Reply #19 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/


--
Thanks Les  de NA5AA

Microsoft Windows: Proof that P.T. Barnum was correct.

24 inch iMac 2.8GHz, 4 GB Ram (OS X 10.8.3 Mountain Lion) Davis Vantage Vue

Offline Tim Hanko

  • Posts: 1,108
  • Grand Rapids, Michigan, USA
    • Walker, MI Weather
Re: How to setup jpgraphs and wxgraphs
« Reply #20 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.
« Last Edit: January 05, 2008, 07:17:11 PM by Tim Hanko »

Offline kewee

  • Posts: 71
Re: How to setup jpgraphs and wxgraphs
« Reply #21 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

Offline dafuser

  • Posts: 571
  • Granbury, Texas
    • Weather from the shores of Lake Granbury
Re: How to setup jpgraphs and wxgraphs
« Reply #22 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.





« Last Edit: January 05, 2008, 09:37:33 PM by dafuser »
--
Thanks Les  de NA5AA

Microsoft Windows: Proof that P.T. Barnum was correct.

24 inch iMac 2.8GHz, 4 GB Ram (OS X 10.8.3 Mountain Lion) Davis Vantage Vue

Offline Tim Hanko

  • Posts: 1,108
  • Grand Rapids, Michigan, USA
    • Walker, MI Weather
Re: How to setup jpgraphs and wxgraphs
« Reply #23 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

Offline jacg

  • Posts: 99
  • Ruinen, Drenthe, The Netherlands
    • Het weer in Ruinen
Re: How to setup jpgraphs and wxgraphs
« Reply #24 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!



Offline dafuser

  • Posts: 571
  • Granbury, Texas
    • Weather from the shores of Lake Granbury
Re: How to setup jpgraphs and wxgraphs
« Reply #25 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

--
Thanks Les  de NA5AA

Microsoft Windows: Proof that P.T. Barnum was correct.

24 inch iMac 2.8GHz, 4 GB Ram (OS X 10.8.3 Mountain Lion) Davis Vantage Vue

Offline dafuser

  • Posts: 571
  • Granbury, Texas
    • Weather from the shores of Lake Granbury
Re: How to setup jpgraphs and wxgraphs
« Reply #26 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

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.
« Last Edit: January 06, 2008, 05:24:27 AM by dafuser »
--
Thanks Les  de NA5AA

Microsoft Windows: Proof that P.T. Barnum was correct.

24 inch iMac 2.8GHz, 4 GB Ram (OS X 10.8.3 Mountain Lion) Davis Vantage Vue

Offline kewee

  • Posts: 71
Re: How to setup jpgraphs and wxgraphs
« Reply #27 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

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

Offline dafuser

  • Posts: 571
  • Granbury, Texas
    • Weather from the shores of Lake Granbury
Re: How to setup jpgraphs and wxgraphs
« Reply #28 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.
--
Thanks Les  de NA5AA

Microsoft Windows: Proof that P.T. Barnum was correct.

24 inch iMac 2.8GHz, 4 GB Ram (OS X 10.8.3 Mountain Lion) Davis Vantage Vue

Offline kewee

  • Posts: 71
Re: How to setup jpgraphs and wxgraphs
« Reply #29 on: January 06, 2008, 03:59:39 AM »
I will give that a try. Thanks for sharing.

Rick