Page 14 of 17

Re: Cumulus Server Sided JpGraph Graphs

Posted: Tue 02 Nov 2010 6:39 pm
by josebp
Hola Gemini, ahora perfecto: :clap:

http://www.tiempoensevilla.es/jpgraph/samp-graph.php

Hay un dicho en español que dice:" nunca te acostarás sin saber una cosa más".
Viene a decir que todos los días se aprende algo nuevo.
Muchas Gracias. :D
Saludos,
José
-----------------------------------------------------------------------------

Hi Gemini, now perfect: :clap:

http://www.tiempoensevilla.es/jpgraph/samp-graph.php

There is a saying in Spanish that says:" nunca te acostarás sin saber una cosa más".
Is to say that every day you learn something new.
Thank you very much. :D
Regards,
José

Re: Cumulus Server Sided JpGraph Graphs

Posted: Wed 03 Nov 2010 4:26 am
by gemini06720
josebp wrote:Hola Gemini, ahora perfecto:
-----------------------------------------------------------------------------
Hi Gemini, now perfect:
José, you must now learn how to remove some of the lines in the images - there are way too many lines in the image - the vertical lines should be removed to make the image 'cleaner'.

In each PHP script (baro.php, dewpt.php, intemp.php, rain.php, temp.php, wind.php and winddir.php) you have to look for the section of code starting with '//x-axis' (without the quotes). For example, in the 'baro.php' file (starting at line 159):

The original code:

Code: Select all

//x-axis
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,6);
$graph->xaxis->SetTickLabels($x);
$graph->xaxis->SetTextLabelInterval($SITE['tick']);
$graph->xaxis->SetPos("min");
$graph->xaxis->HideTicks(true,true);
$graph->xaxis->SetColor($SITE['txtcolor']);
$graph->xgrid->Show(true);
There are two (2) lines to modify:
- the one containing: $graph->xaxis->HideTicks(true,true);
- the one containing: $graph->xgrid->Show(true);

The modified code:

Code: Select all

//x-axis
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,6);
$graph->xaxis->SetTickLabels($x);
$graph->xaxis->SetTextLabelInterval($SITE['tick']);
$graph->xaxis->SetPos("min");
$graph->xaxis->HideTicks(true,false);
$graph->xaxis->SetColor($SITE['txtcolor']);
$graph->xgrid->Show(false);
These modifications will add (very) small vertical bars (called 'ticks') above the hours and remove the long vertical bars above the hours - the image is now much cleaner to look at... :)

And when you get more familiar and more comfortable with the PHP scripts, then you have to create/duplicate the scripts to make the images much larger, such as this large 24 Hour Temperature/Humidity Weather Graphic... ;)

Re: Cumulus Server Sided JpGraph Graphs

Posted: Wed 03 Nov 2010 7:36 pm
by josebp
Hola Gemini, ahora mucho mejor. :o
Tendré que ir aprendiendo poco a poco.
Tienes una cerveza pagada en Sevilla. ;)
Muchas gracias por vuestra ayuda. :D
Saludos,
José

-----------------------------------------------------------------

Hi Gemini, much better. :o
I have to go slowly learning.
Have a beer paid in Seville. ;)
Thank you very much for your help. :D
Regards,
José

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 25 Mar 2011 10:10 am
by Krumlov
Hi Guys,

Can someone have a look at my graphs and see if they look ok (these are test pages). I currently only have few days data:

http://www.users.on.net/~gavin_n/weathe ... -graph.php
http://www.users.on.net/~gavin_n/weather/tempH.php

My main concern is the x-axis. It doesn't have as many labels as the other graphs I have seen on other's pages and should the far right of the graph be the current time with the previous data leading up to it? If so, that isn't working correctly because the x-axis time seems fixed to me. It starts at 11pm which bears no resemblance to the time when I am writing this (8pm)?

Thanks for the help...

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 27 May 2011 8:42 pm
by RayProudfoot
Hi all,

PANIC OVER! Ignore below. I wasn't entering the correct path to the fonts folder. It should have been:-

/home/admin4/public_html

I'm trying to add these jpGraphs to my site but things are not going well. This may require David's help as he's my web server host.

I've extracted and uploaded the required files into the src folder. The actual path is /public_html/jpgraph/src

My fonts are in a higher level folder hanging off the root folder ( public_html). I've edited jpg-config.inc.php and uploaded it to the server with the following line changed for TTFonts...

define('TTF_DIR','/public_html/fonts/');

But when I load this test page http://www.cheadlehulmeweather.co.uk/jp ... stsuit.php I only see 'font is not readable or does not exist'.

I feel the path to the fonts folder is wrong as it definitely contains some of the required fonts.

Can someone tell me what I'm doing wrong please? All this is very new to me.

LATER: If you follow this link to where my fonts are stored you'll see they are there and are readable.

http://www.cheadlehulmeweather.co.uk/fonts/arial.ttf

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 27 May 2011 10:08 pm
by RayProudfoot
Okay, I'm back again and this time I really am stuck.

I've loaded all the required fonts to the server and uploaded the graph folder too. I should be able to see a sample graph on this link but nothing shows. What have I done or not done?

http://www.cheadlehulmeweather.co.uk/samp-graph.php

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 27 May 2011 10:17 pm
by steve
RayProudfoot wrote:I should be able to see a sample graph on this link but nothing shows. What have I done or not done?
It gives a 404, so you haven't uploaded a file called samp-graph.php to the root of your web space.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 27 May 2011 10:26 pm
by RayProudfoot
Sorry, wrong path. It should be this one.

http://www.cheadlehulmeweather.co.uk/gr ... -graph.php

Is that what I should be seeing? It doesn't seem right.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 27 May 2011 10:30 pm
by 6719jason
RayProudfoot wrote:Sorry, wrong path. It should be this one.

http://www.cheadlehulmeweather.co.uk/gr ... -graph.php

Is that what I should be seeing? It doesn't seem right.
Right - looks like it needs to read some data from realtime.log

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 27 May 2011 10:35 pm
by RayProudfoot
Hi Jason,

I was hoping you'd turn up as I got this idea after looking at your site. So in a way, you're to blame for the last 4 hours this has been driving me mad! :lol:

I don't have a realtime.log but I do have a realtime.txt in the root folder. Can that be used and if so do I need to change that config file the name of which escapes me?

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 27 May 2011 10:45 pm
by RayProudfoot
I suspect it's to do with font locations. There's an error.log on the server with a lot of entries. Here are a couple of lines...

[27-May-2011 23:40:01] PHP Warning: imageloadfont(/home/admin4/public_html/jpgraph/src/fonts/FF_FONT2.gdf) [<a href='function.imageloadfont'>function.imageloadfont</a>]: failed to open stream: No such file or directory in /home/admin4/public_html/jpgraph/src/gd_image.inc.php on line 93
[27-May-2011 23:40:01] PHP Warning: imageloadfont(/home/admin4/public_html/jpgraph/src/fonts/FF_FONT1-Bold.gdf) [<a href='function.imageloadfont'>function.imageloadfont</a>]: failed to open stream: No such file or directory in /home/admin4/public_html/jpgraph/src/gd_image.inc.php on line 94
[27-May-2011 23:40:01] PHP Warning: imageloadfont(/home/admin4/public_html/jpgraph/src/fonts/FF_FONT2-Bold.gdf) [<a href='function.imageloadfont'>function.imageloadfont</a>]: failed to open stream: No such file or directory in /home/admin4/public_html/jpgraph/src/gd_image.inc.php on line 95

It looks like it's looking for fonts in public_html/jpgraph/src/fonts but they're located in /public_html/fonts

I'm confused.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 27 May 2011 10:48 pm
by 6719jason
RayProudfoot wrote:Hi Jason,

I was hoping you'd turn up as I got this idea after looking at your site. So in a way, you're to blame for the last 4 hours this has been driving me mad! :lol:

I don't have a realtime.log but I do have a realtime.txt in the root folder. Can that be used and if so do I need to change that config file the name of which escapes me?
Hi Ray :D

LOL :lol:

Right'o.... You will need to open realtimelog.php in a Text Editor and edit the following settings to match yours...

$SITE['home'] = "./";
$SITE['datafile'] = "realtime.log";
$SITE['source'] = "realtime.txt";

Save the file ensuring that it remains .php and upload realtimelog.php to your ./graphs webfolder

You should then 'Call' realtimelog.php by visiting it in your web browser - It will let you know if there has been an issue - it will also create realtime.log for you!

Hope that helps :)

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 27 May 2011 11:18 pm
by 6719jason
6719jason wrote: $SITE['home'] = "./";
$SITE['datafile'] = "realtime.log";
$SITE['source'] = "realtime.txt";
I've just visited your website and called realtimelog.php and I think you need the following as your settings...

$SITE['home'] = "../";
$SITE['datafile'] = "realtime.log";
$SITE['source'] = "realtime.txt";

I maybe wrong - thinking back it may not do any harm to create a blank file called realtime.log ensuring that when its uploaded it remains .log and not .log.txt

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 27 May 2011 11:21 pm
by RayProudfoot
Hi Jason,

http://www.cheadlehulmeweather.co.uk/gr ... .php?debug

Shows the contents of the file but not what it should I suspect.

To clarify what I've done...

1) Created realtime.log and uploaded it to the root server folder. It's currently empty.
2) Created realtimelog.php containing what you said but with my root path entered. Uploaded to graphs folder.

I googled realtimelog.php and found this article but it's pretty heavy stuff. https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=130

It's getting late. I'll give it another 20 mins for your reply but if you're tired let's leave it until later today.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Fri 27 May 2011 11:24 pm
by 6719jason
RayProudfoot wrote:Hi Jason,

http://www.cheadlehulmeweather.co.uk/gr ... .php?debug

Shows the contents of the file but not what it should I suspect.

To clarify what I've done...

1) Created realtime.log and uploaded it to the root server folder. It's currently empty.
2) Created realtimelog.php containing what you said but with my root path entered. Uploaded to graphs folder.

I googled realtimelog.php and found this article but it's pretty heavy stuff. https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=130

It's getting late. I'll give it another 20 mins for your reply but if you're tired let's leave it until later today.
Hi Ray - Not sure if you have seen my previous post or not - I've attached my realtimelog.php to this message as I'm not quite sure whats in your realtimelog.php

It can be a bit heavy but we'll get you there :)