cloudy cloudy

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

0 Members and 1 Guest are viewing this topic.

Offline Dave.B

  • Posts: 97
  • Kingsteignton, Devon, UK
    • Kingsteignton Weather.co.uk
Windows path issues?
« Reply #30 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...

Offline Tim Hanko

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


Offline Dave.B

  • Posts: 97
  • Kingsteignton, Devon, UK
    • Kingsteignton Weather.co.uk
Re: How to setup jpgraphs and wxgraphs
« Reply #32 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...

Offline broadstairs

  • Stuart
  • Posts: 7,009
  • Broadstairs, Kent, UK
    • Broadstairs
Re: How to setup jpgraphs and wxgraphs
« Reply #33 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

Offline Dave.B

  • Posts: 97
  • Kingsteignton, Devon, UK
    • Kingsteignton Weather.co.uk
Re: How to setup jpgraphs and wxgraphs
« Reply #34 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.

Offline broadstairs

  • Stuart
  • Posts: 7,009
  • Broadstairs, Kent, UK
    • Broadstairs
Re: How to setup jpgraphs and wxgraphs
« Reply #35 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

Offline Dave.B

  • Posts: 97
  • Kingsteignton, Devon, UK
    • Kingsteignton Weather.co.uk
Re: How to setup jpgraphs and wxgraphs
« Reply #36 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...

Offline stumpey

  • Posts: 769
  • Sunbury on Thames UK
    • Sunbury Weather
Re: How to setup jpgraphs and wxgraphs
« Reply #37 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
« Last Edit: February 27, 2008, 09:22:53 AM by stumpey »

Offline broadstairs

  • Stuart
  • Posts: 7,009
  • Broadstairs, Kent, UK
    • Broadstairs
Re: How to setup jpgraphs and wxgraphs
« Reply #38 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



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

Offline stumpey

  • Posts: 769
  • Sunbury on Thames UK
    • Sunbury Weather
Re: How to setup jpgraphs and wxgraphs
« Reply #39 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

Offline Dave.B

  • Posts: 97
  • Kingsteignton, Devon, UK
    • Kingsteignton Weather.co.uk
Re: How to setup jpgraphs and wxgraphs
« Reply #40 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?

Offline broadstairs

  • Stuart
  • Posts: 7,009
  • Broadstairs, Kent, UK
    • Broadstairs
Re: How to setup jpgraphs and wxgraphs
« Reply #41 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


Offline broadstairs

  • Stuart
  • Posts: 7,009
  • Broadstairs, Kent, UK
    • Broadstairs
Re: How to setup jpgraphs and wxgraphs
« Reply #42 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

Offline stumpey

  • Posts: 769
  • Sunbury on Thames UK
    • Sunbury Weather
Re: How to setup jpgraphs and wxgraphs
« Reply #43 on: February 04, 2008, 07:55:13 PM »
Wooo

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

Steve

Offline broadstairs

  • Stuart
  • Posts: 7,009
  • Broadstairs, Kent, UK
    • Broadstairs
Re: How to setup jpgraphs and wxgraphs
« Reply #44 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 and the test HTML file can be viewed here on my website.

Stuart

 

cumulus