Page 5 of 18

Re: Server Generated Graphs for MX

Posted: Mon 09 Mar 2015 6:54 pm
by n9mfk
Hi Mark
after some reading I found out the how the cache woks in jpgraph
is for it to make folder for the caching where ever the script is run from
so it is working just not where i expected Beau

Re: Server Generated Graphs for MX

Posted: Mon 09 Mar 2015 7:17 pm
by mcrossley
Adrian Hudson wrote:Hi Mark,

Just a quick thank you for these graphs. Very nice. They work perfectly.

Can I ask, have you ever programmed in Fortran in your dim and distant past?

Adrian
Great, glad they are working for you. Fortran, wayyyyy back first/second year at uni - on punch cards!

Re: Server Generated Graphs for MX

Posted: Tue 10 Mar 2015 6:28 pm
by n9mfk
Hi mark
I had 0.07 of rain today but the graph are showing 0.1
whats needs changed


http://n9mfk.info/raindata.json

http://n9mfk.info/images/graphRain.php

mx charts http://n9mfk.info/cumulus/wxcharts.php
thanks Beau

Re: Server Generated Graphs for MX

Posted: Tue 10 Mar 2015 7:49 pm
by Adrian Hudson
Fortran, wayyyyy back first/second year at uni - on punch cards!
I thought so... Your loop counters i and j gave it away. (me too, Fortran, punch cards, uni, IBM 370-145).

Re: Server Generated Graphs for MX

Posted: Tue 10 Mar 2015 9:08 pm
by mcrossley
n9mfk wrote:Hi mark
I had 0.07 of rain today but the graph are showing 0.1
whats needs changed


http://n9mfk.info/raindata.json

http://n9mfk.info/images/graphRain.php

mx charts http://n9mfk.info/cumulus/wxcharts.php
thanks Beau
Try version 0.4, which I think should fix this.

Re: Server Generated Graphs for MX

Posted: Tue 10 Mar 2015 9:41 pm
by n9mfk
Hi Mark,
that Update fixed the problem
Thanks beau

Re: Server Generated Graphs for MX

Posted: Wed 17 Jun 2015 7:12 pm
by kocher
Hi Mark

Thank you very much for your good work. :clap:
I see the "graphSettings.php" file on line 112:

Code: Select all

include 'db_ro_details.php';
What terms?

Javier

Re: Server Generated Graphs for MX

Posted: Wed 17 Jun 2015 7:42 pm
by water01
These are the settings for your MySQL database access so that the PHP code can access your database to obtain the data for the graphs.

Re: Server Generated Graphs for MX

Posted: Wed 17 Jun 2015 8:00 pm
by kocher
Hi David

Thanks for your answer. :)

I guess it's a common file for all charts that connect to the database

So I have to create the "db_ro_details.php" file?


regards

Re: Server Generated Graphs for MX

Posted: Wed 17 Jun 2015 9:16 pm
by water01

Code: Select all

<?php

// The server host name or number running your MySQL database
// usually 127.0.0.1 or localhost will suffice
$dbhost    = "localhost";
//
// The username used to log-in to your database server
$dbuser    ="YOUR USERNAME";
//
// The password used to log-in to your database server
$dbpassword   ="YOUR PASSWORD";
//
// The name of the MySQL database we will store the tables in
$database   ="YOUR DATABASE NAME";

?>
Use the above code saved as db_ro_details.php and substitute your settings in the last 3 parameters.

Re: Server Generated Graphs for MX

Posted: Wed 17 Jun 2015 9:54 pm
by kocher
Ok David

thank you very much :D


Javier

Re: Server Generated Graphs for MX

Posted: Wed 17 Jun 2015 10:11 pm
by mcrossley
My reply seems to have gone missing, but I advise that you create the include file in a location inaccessible to the web server but on the PHP include path.

Re: Server Generated Graphs for MX

Posted: Fri 19 Jun 2015 4:42 pm
by Big Daddy
Need a bit of help please.

I managed to get the graphs working ok on my local Windows pc running Apache. It took me a while as I am a total novice but all working and caching ok.

I tried to move to my hosted website and changed the directories in the files as appropriate but when I run them on my website with Firefox I just get a blank page, no errors no nothing. With IE I get a HTTP 500 message. If I mispell the path I am entering I get a message to say object is not found or a 404 error so I assume everything is in the right place. Image is not being created on the website and nothing in the cache. When I was testing locally if I got something wrong I would get a "couldnt include XXX/XXX/ error and that sort of thing.

I ran a php info on the webserver and it shows its running PHP 5.5.25, I ran a checkgd.php (as per the jpgraph manual) and that is fine. I have tried in several directories and modified the files accordingly and I think I have got this right after spending a lot of time trying to undertsnad and work this out on my local server.

Have been sat staring at this all day but cannot seem to find the answer. It must be simple. Could it be the include_path. I cant access the php.ini file on my hosted server but running a echo get_include_path(); in a php file shows .:/usr/lib/php:/usr/local/lib/php. I dont know if this is right.

I read earlier in this post about using ./ for the directories and the full folder name for the cache file but it doesnt seem to change anything.

My local files are located in htdocs/midlifedad/jpgraph and the cache is in htdocs/midlifedad/jpgraph/cache. All my JSON and php scripts are in htdocs/midlifedad/jpgraph. My jpg-config file shows as follows define('CACHE_DIR','cache/'); and my graphsettings file has the following
$GRAPH['jsonloc'] = "";
$GRAPH['jpgraphloc'] = "/midlifedad/jpgraph/";
This all works fine, displys the graph and caches.

The settings for my website currently show (and I have changed them a lot)
files are located in public_html/weather/jpgraph and the cache is in public_html/weather/jpgraph/cache.
All my JSON and php scripts are in public_html/weather/jpgraph.
My jpg-config file shows as follows define('CACHE_DIR','cache/'); and my graphsettings file has the following
$GRAPH['jsonloc'] = "";
$GRAPH['jpgraphloc'] = "/weather/jpgraph/";

Would really appreciate somebody pointing me in the right direction.

Thanks
Andy

Re: Server Generated Graphs for MX

Posted: Fri 19 Jun 2015 8:47 pm
by Big Daddy
Hi All,
So just an update following some more testing.

Loaded jpgraph from scratch. Ran phpinfo.php, checkgd.php, checkgd2.php and checkttf.php as per the jpgraph documentation and all worked ok. Tried to run Tried jpgraph/src/Examples/example0.php - Blank page.

Headed over to TNET and found the instructions there. started from scratch again. Followed to the letter and exactly the same happens when I try and run jpgraph/src/Examples/testsuit.php. same as before and running the example0.php file also results in a blank page. I am totally lost with this one now. Its almost as if my hosting site is causing the problem. Does anyone know where to start to look or what to even ask them.

Thanks
Andy

Re: Server Generated Graphs for MX

Posted: Fri 19 Jun 2015 9:18 pm
by mcrossley
Andy, in on my phone at the most do I can't investigate properly, but I suspect your web hoster has disabled error messages. You should be able to switch them on again for an individual script by adding the appropriate command at the top of the script. You'll have to Google for the command I'm afraid.