Hi Krister,
that did the trick. Many thanks for helping me out to continue using this excellent script.
Since we have to edit every new year, would it be an idea to modify the script according to changes made by Murry C. to the wxraindetail.php as per http://discourse.weather-watch.com/t/39306?
Many thanks, Dick
$startyear = '2006'; //Change to the year your data starts
$year[$startyear] = $startyear;
for ($i = $startyear; $i < date(Y); $i++) {
$year[$i + 1] = ($i + 1);
}
Currently I get a similar error (shows alt text not graph) and I’ve not sorted it yet either! I dont have a page visible on the net though its on a local server.
Well I sorted mine on my local server, I did not have the JPGraph font definition correct. So make sure you have this correct and if you dont have control over it them make sure the font (VERDANA) is actually installed on your host, if not use a different font in the multigraph.php script.
Stuart
Edit: Lars I just ran the multigraph.php script directly on your host and you do not have either the jpgraph path correct or you have not installed jpgraph, so fix that first.
I have jpgraph installed but now i get this error when accessing multigraph.php directly.
Warning: Wrong parameter count for min() in /mounted-storage/home46b/sub035/sc73389-BRUN/axelvold.net/multiwx/get_data.php on line 105
Warning: Wrong parameter count for max() in /mounted-storage/home46b/sub035/sc73389-BRUN/axelvold.net/multiwx/get_data.php on line 106
JpGraph Error Font file "H:/htdocs/jpgraph/fonts/verdana.ttf" is not readable or does not exist.
Well you have to configure the path to the fonts for JPGraph in a file called jpg-config.inc.php which is in the src directory, make it point at the directory containing the verdana ttf files.
I’d ignore the warning for now and see what happens.
I have corrected the settings in jpg-config.ini.php
But now i get this error.
Warning: Wrong parameter count for min() in /mounted-storage/home46b/sub035/sc73389-BRUN/axelvold.net/multiwx/get_data.php on line 105
Warning: Wrong parameter count for max() in /mounted-storage/home46b/sub035/sc73389-BRUN/axelvold.net/multiwx/get_data.php on line 106
JpGraph Error: HTTP headers have already been sent.
Caused by output from file get_data.php at line 105.
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".
Hi
I have updated the script with all modifications on previous pages and a new and hopefully better MySql-query for date and time tables.
Krister
Oops, i forgot to save the last changes #-o
If you already have installed it, replace:
case 'yes':
if ($field[2]) {
$que1 = ("$data_1, $data_2, $data_3 FROM $table WHERE DATETIME $time_1 AND $data_1 and $data_2 and $data_3");
} elseif ($field[1]) {
$que1 = ("$data_1, $data_2 FROM $table WHERE DATETIME $time_1 AND $data_1 and $data_2");
} elseif ($field[0]) {
$que1 = ("$data_1 FROM $table WHERE DATETIME $time_1");
} else {
$que1 = ("Temperature FROM $table WHERE DATETIME <=NOW() and DATETIME>=DATE_SUB(NOW(), INTERVAL 24 hour)");
}
//Make a query
//SELECT DATETIME, temperature FROM wx_data WHERE DATETIME BETWEEN '2008-03-16 00:00:00' AND '2008-03-16 23:59:59' AND DATETIME REGEXP '..:(00|10|20|30|40|50):..' AND temperature IS NOT NULL ORDER BY DATETIME ASC
$sql = mysql_query("SELECT DATETIME, $que1 AND $data_1 IS NOT NULL ORDER BY DATETIME ASC") or
die("getmysql error");
break;
in get_data.php with:
case 'yes':
if ($field[2]) {
$que1 = ("$data_1, $data_2, $data_3 FROM $table WHERE DATETIME $time_1 AND $data_1 and $data_2 and $data_3 IS NOT NULL");
} elseif ($field[1]) {
$que1 = ("$data_1, $data_2 FROM $table WHERE DATETIME $time_1 AND $data_1 and $data_2 IS NOT NULL");
} elseif ($field[0]) {
$que1 = ("$data_1 FROM $table WHERE DATETIME $time_1 AND $data_1 IS NOT NULL");
} else {
$que1 = ("Temperature FROM $table WHERE DATETIME <=NOW() and DATETIME>=DATE_SUB(NOW(), INTERVAL 24 hour)");
}
//Make a query
//SELECT DATETIME, temperature FROM wx_data WHERE DATETIME BETWEEN '2008-03-16 00:00:00' AND '2008-03-16 23:59:59' AND DATETIME REGEXP '..:(00|10|20|30|40|50):..' AND temperature IS NOT NULL ORDER BY DATETIME ASC
$sql = mysql_query("SELECT DATETIME, $que1 ORDER BY DATETIME ASC") or
die("getmysql error");
break;
Excelent script ! Thanks Krister got it to work nicely
One question: How to get the text wider and spaces between the words
‘Compare Temperatures’
and
dates interval and the word ‘with’ – dates interval (see att)
I used
to get the space in common_en
and widener the text in multi.css but no effects :oops: