How to setup jpgraphs and wxgraphs

I don’t see those problems, your gauges and graphs are working OK for me in Chrome.

Have you tried clearing the browser cache in Chrome and Safari?

Managed to get it set up, but curiously all the graphs on the test page appear to be using the default font apart from the Snow graph, which appears to be using arial. Any ideas?
http://www.costa-mogan.com/weather/wxgraphs/wxgraphs_test.html

This was an error on my part. I will take a close look at the snow.php file and provide a modified version in a day or so. It’s easy to forget when changing so many files.

Stuart

The corrected version of the snow.php graph script is shown here simply copy and paste this into the snow.php file you have now and it should obey the font settings in the config file.


<?php
// Graphs Package V3.0 21st November 2016
if (!file_exists("graphsconf.php")) include("error_msg.php");
include ("graphsconf.php");
if (!file_exists($jploc."jpgraph.php")) {
  $string = "Unable to find JPGraph files";
  create_image1($string,$jploc);
  exit;
}
include ($jploc."jpgraph.php");
include ($jploc."jpgraph_bar.php");

$clientrawextra = get_raw ("${hostloc}clientrawextra.txt");//for this graph we only need the values from this file

// Here we create an array of the values we need depending of the month we are in (each month we shift to the left 1 place)
$x=array();
$y=array();

$y=array($clientrawextra['479'],$clientrawextra['480'],$clientrawextra['481'],$clientrawextra['697']);

$datay = $y;

if ($snow_conv != 1) {
	array_walk($datay, "SMtoI");
	}

//With this-one we calculate the labels for the x-axis
$curmth = date("n");

$x = array($txt_today,$month_array[$curmth],$txt_season,$txt_depth);

// Create the graph. These two calls are always required
$graph = new Graph($xsize,$ysize,"auto",60);	
$graph->SetScale("textlin");

//Setup margin color
$graph->SetMarginColor("$margincolour");

//Here we set a dropshadow around the graph
$graph->SetShadow();

// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(30,30,30,40);

// Create a bar pot
$bplot = new BarPlot($datay);

//Setup width of bars
$bplot->SetWidth(0.7);

// Setup color for gradient fill style 
$bplot->SetFillGradient("$snow_col","#EEEEEE",GRAD_LEFT_REFLECTION);

// Use 10% "grace" to get slightly larger scale then max of
// data or the value of max will end up in the title area
// you can commend this out if you dont show the values themselves
$graph->yscale->SetGrace(10);

// Create a line plot
$bplot = new BarPlot($datay);
$graph->Add($bplot);

$bplot->SetWeight(2);
$bplot->SetColor("$snow_col");
$bplot->SetFillGradient("$snow_col","#EEEEEE",GRAD_LEFT_REFLECTION);
if  ($bar_snow == 1) {
    $bplot->SetValuePos($bar_pos);
    $bplot->value->Show();
    $bplot->value->SetAngle($bar_angle);
    $bplot->value->HideZero();
    $bplot->value->SetColor($barTXT_col);
    $bplot->value->SetFormat("$snow_format");
    eval ($bset);
//    $bplot->value->SetFont(FF_FONT0,FS_BOLD,6);
    eval ($bsetv);
    }

// Setup the titles
eval ($tset);
$graph->title->Set("$txt_snow ($snow_unit)");
$graph->title->SetColor("$textcolour");

//x-axis
eval ($xtset);
eval ($xset);
$graph->xaxis->SetTickLabels($x); 
$graph->xaxis->SetTextLabelInterval(1);
$graph->xaxis->SetPos("min");
//$graph->xaxis->SetFont(FF_FONT0,FS_BOLD,8); 
$graph->xgrid->Show(true);
$graph->xaxis->SetColor("$xtextcolour"); 
$graph->xaxis->SetTickLabels($x);

//y-axis
eval ($yset);
//$graph->title->SetFont(FF_FONT0,FS_BOLD,10);
//$graph->yaxis->SetFont(FF_FONT0,FS_BOLD,8);
$graph->yaxis->SetColor("$ytextcolour");
$graph->yaxis->HideTicks(true,true); 

// Display the graph
$graph->Stroke();
?>

Stuart

I have updated my wxgraphs.zip file to contain the new version of snow.php, so any new downloads will get the updated file.

Stuart

https://weather.scottsworld.info/wxgraphs/wxgraphs.html

Up and running, but all the values are metric except wind which is in MPH. I know nothing about php, I can code html and css.

Two of the solar files

generate this error. Would it ber possible to have the same UV files as the solar.

The error log showed it did not like UTC-7 for timezone but gave the error with a date America/Denver so I tried America/Phoenix but it did not seem to understand that so I changed it back to Denver which Phoenix is MST time but does not follow daylight savings.

#1 Fix the solar errors by getting the arialbd.ttf file into the location in the error message. That file should be found in the jpgraph download but is maybe in a different folder, or I’m sure there is one on your PC that you can use.

#2 All the units are set in the graphsconf.php file starting around line 80. Open it in any plain text editor, it is well commented, you should have no trouble finding and setting the units.

#3 Arizona time zone is problematic, I need to research that some more.

After skimming though other messages I looked farther into the config file and got the units changed. Will try the fonts tomorrow, the tv is my monitor for the weather station… Any hints on getting …/gauges-ss-basic-inc.php working? I had SS guages working, then WD crashed and I could not get it to work any more. linking php files

<img src="baro_1hr.php"

was something I did not know until I looked at the test page.

WD doesn’t provide separate graphs – the JPGraph set of scripts are used to display the mouse-over graphs when Weather-Display is used.

Could not figure out where it was looking for the Ariel Bold fonts. I searched for ttf and they are all over the computer. I opened the solar files and compared the working files to the non working ones. The difference is the working ones have the fonts are // commented out and the non working ones were not. So I edited the non working ones adding // before the fonts and that seems to have fixed it. Though one of the 4 have disapeared.

Hi!
I just made graphs on gauges with great help on the first page of this topic. Everythng works fine. Just looking forward to translate graph to Slovenian language.
Thanks guy,s

Here the graphs: http://www.s52sk.com/wmr200/wx.html

Marco

After changing to a new host, I found my jpgraphs stopped working. So I downloaded the latest version of jpgraphs and wxgraphs and it is still not working. Really messed something up here.
https://mad-weather.com/wxgraphs/wxgraphs_test.html right click to view an image and you get the following error Chosen locale file (“lang/en.inc.php”) for error messages does not exist or is not readable for the PHP process. Please make sure that the file exists and that the file permissions are such that the PHP process is allowed to read this file.
But the file is there, so very confused about that.
Error log for wxgraphs gives hundreds of the following type message PHP Warning: imageloadfont(/home/madweather/public_html/jpgraph-4.2.6/src/fonts/FF_FONT0.gdf): failed to open stream: No such file or directory in /home/madweather/public_html/jpgraph-4.2.6/src/gd_image.inc.php on line 92
Those fonts are there from what I can see.
Any help on this would be much appreciated, thank you.
Rosalind
Edited: Played around with this. Renamed the folder to just jpgraph. I now don’t get any errors but just a black page. In Firefox it does say that the image cannot be displayed because it contains errors. Grrrr.

I found an older 3.5 version of jpgraphs to try that and see if it works and I still get the same result. The newest version does not have the src folder, but that shouldn’t make a difference. I get the image cannot be displayed because it contains errors, but I don’t know what the errors are.
The only difference with the hosting is that I am using Litespeed but it is the same php version as previously used and GD is enabled.

I just downloaded the free version of JPGraphs 4.2.6 and it does indeed have an src folder. If yours is missing then something is wrong. If the src folder is missing they graphs will NOT work. Dont know anything about Litespeed web server so cannot help there.

Stuart

Edit: I just tested my install with 4.2.6 using Apache and it works fine.

I have run my site on Litespeed, it will not be a problem.

The first jpgraph did not unzip properly so did it again and got the src folder. I had the contents of the src folder which is why I didn’t initially work out it wasn’t right.

Anyway, it didn’t make any difference they still don’t work.

I did new uploads of both jpgraph and wxgraphs. Edited the graphsconf.php to point to jpgraph, but then I get the same result.

Have also set the path for ttf files.

I also tried setting a hardpath for the WEBROOT and nada.

Flummoxed!

Think I have solved it. I hunted around on the internet for the error and it suggested a blank space in the code.
When I try and edit via my ftp program, for some reason it adds an extra line to the code, no idea why it does this. So edited via a very old Dreamweaver and it doesn’t add the extra lines and so far the test page is working.
Hope this might help someone else.
Rosalind

I had to move my hosting and wxgraphs has stopped working. How do I config it for https://scottsworld.info/weather/index.html as the url changed

https://weather.scottsworld.info/wxgraphs/wxgraphs_IIStest.html I finally got WXgraphs working again under php 7.3 (bluehost my new server only offers 7.0 - 7.3) and jpgraph-4.2.9 (latest version I downloaded. But

Rain gauges all say illegal error