Page 3 of 18

Re: Server Generated Graphs for MX

Posted: Wed 28 Jan 2015 11:37 am
by mcrossley
Hi Ron, you can put them where you want, so long as they are accessible. You need to edit the JPGraph config file to enable caching and point it at your cache folder. Then edit the graphSettings.php script and set the cache folder and jpgraph fodler locations in there.

Re: Server Generated Graphs for MX

Posted: Wed 28 Jan 2015 12:05 pm
by nitrx
Sorry doesn't work I've no idea but leave it you said not to put much effort in it.
Thanks

Re: Server Generated Graphs for MX

Posted: Wed 28 Jan 2015 12:09 pm
by steve
You need to enable the popup graphs in gauges.js. You currently have

showPopupGraphs : false, //If popup data is displayed, show the graphs?

Re: Server Generated Graphs for MX

Posted: Wed 28 Jan 2015 12:54 pm
by nitrx
You're right Steve , I've upladed with graphpopups now but there are no graphs created on the server.

Re: Server Generated Graphs for MX

Posted: Wed 28 Jan 2015 12:56 pm
by mcrossley
Ron, where are the graphXxxxx.php files located on your server?

Re: Server Generated Graphs for MX

Posted: Wed 28 Jan 2015 1:02 pm
by nitrx
mcrossley wrote:Ron, where are the graphXxxxx.php files located on your server?
They are in apeldoornmeteo.nl/cumulus and in apeldoornmeteo.nl/cumulus/images I've made in both a dir with /jpgraph and a /cache in the /jpraph ( I chmod /cache to 777)
EDIT I've only uploaded the content of src from the jpgrap package to /jpgraph do I dont have /jpgraph/src ...

Re: Server Generated Graphs for MX

Posted: Wed 28 Jan 2015 5:15 pm
by laulau
mcrossley wrote: Guess how I do mine :lol: I don't have MX uploading the json files, just my tag files, so yes I just query my real time MySQL table.
I'm a little lost to rearrange the data extracted with realtileLog Sql script to match those from CMX jsongraph files!:groan:
Some help would be appreciated .

Re: Server Generated Graphs for MX

Posted: Wed 28 Jan 2015 7:55 pm
by swyman18
If it helps anyone, I had to use the ./ syntax for the locations in the graphSettings.php file in order to get it to work. I assume that is because my webhost is linux.

$GRAPH['jsonloc'] = "./";
$GRAPH['jpgraphloc'] = "./jpgraph/src/";
$GRAPH['jpgraphcache'] = "./jpgraph/cache/";

And I made sure I used the full absolute path in the cache definition in the jpg-config.inc.php file.

define('CACHE_DIR','/home/content/#/#/#/########/html/jpgraph/cache/'); for example.

Re: Server Generated Graphs for MX

Posted: Thu 29 Jan 2015 2:05 pm
by mcrossley
Another thing to check - that your installation meets the requirements for JPGraph...

http://jpgraph.net/download/manuals/chu ... 03s02.html

Re: Server Generated Graphs for MX

Posted: Thu 29 Jan 2015 3:34 pm
by laulau
laulau wrote:
mcrossley wrote: Guess how I do mine :lol: I don't have MX uploading the json files, just my tag files, so yes I just query my real time MySQL table.
I'm a little lost to rearrange the data extracted with realtileLog Sql script to match those from CMX jsongraph files!:groan:
Some help would be appreciated .
I think i got it :D

Re: Server Generated Graphs for MX

Posted: Thu 29 Jan 2015 3:48 pm
by mcrossley
Hi Laurent, I do have a solution but it involves a slight change to all the graph files as well as a new get_data() function. The code for fetching the data is just the same as my HighCharts 'recent graphs' - almost! Still, you had fun working it out for yourself :clap:

Re: Server Generated Graphs for MX

Posted: Thu 29 Jan 2015 4:47 pm
by laulau
I changed the reorg_data function and the appropriate call to the realtimeSglLog script of the 'switch case' in graphSettings.php.

Code: Select all

function reorg_data1($dat) {
	$keyname = array(
		"press" => "Pressure",
		"rfall" => "Rain today",
		"rrate" => "Rain rate",
		"hum" => "Outdoor humidity",
		"inhum" => "Indoor humidity",
		"temp" => "Temperature",
		"intemp" => "Indoor",
		"dew" => "Dew point",
		"apptemp" => "Apparent temp",
		"wchill" => "Wind chill",
		"bearing" => "Direction",
		"avgbearing" => "Average direction",
		"wspeed" => "Wind speed",
		"wgust" => "Wind gust",
		);	
	$keys = array_keys($dat);
	$retVal = array();
	
 
    for ($i = 0; $i < count($keys); $i++) {
        
		$key = $keys[$i];
		
        for ($j = 0; $j < count($dat[$key]); $j++) {
            if ($i === 0) {
                // JavaScript time in msecs, convert to secs
                $retVal['time'][] = $dat[$key][$j][0] / 1000;
            }
            $retVal[$keyname[$key]][] = $dat[$key][$j][1];
        }
    }
	
    return $retVal;	
}
Now i have to place the graph files in the right place and look at the .htaccess file.

Re: Server Generated Graphs for MX

Posted: Sat 31 Jan 2015 1:27 pm
by water01
steve wrote:
water01 wrote:Using MX though I am going to get some .htm files uploaded though for the moment as the option to just upload .json files and not the .htm files does not yet exist.

Let Steve complete the Beta first as it is not that important.
That's a fairly easy and useful change, though, so I'll look at doing that.
Meant to say Thank You for doing this Steve, improved my upload times and stopped using bandwidth I didn't need to !!

Re: Server Generated Graphs for MX

Posted: Sat 14 Feb 2015 9:32 pm
by mcrossley
I have added a version of the graph scripts that gets it data from a MySQL 'realtime' table. This allows you to graph anything in the realtime table, the package contains an additional graph for cloudbase.

Re: Server Generated Graphs for MX

Posted: Mon 16 Feb 2015 10:30 am
by water01
Mark, I assume the data used is longer than the standard 2 hr realtime.log highcharts one in the wiki and involves a MySQL script of some kind to get the data into a database. Any chance of getting a copy of the code to build the database?