cloudy cloudy

Author Topic: How to setup jpgraphs and wxgraphs  (Read 192445 times)

0 Members and 1 Guest are viewing this topic.

Offline jensb

  • Posts: 249
  • Sweden
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 53.0.2785.116
    • Gudmundsbyn
Re: How to setup jpgraphs and wxgraphs
« Reply #405 on: September 21, 2016, 03:18:17 PM »
The graph location is defined in gauges.js:

            imgPathURL        : './images/',

sigh ... I searched for wxgraphs and a setting for location :)

should this point to /wxgraphs/ ? ie imgPathURL         : '/customers/7/d/e/gudmundsbyn.se//httpd.www/wxgraphs/',

and should I leave oldGauges as it is (since I donīt have any)

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 27,850
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 51.0.2704.106
Re: How to setup jpgraphs and wxgraphs
« Reply #406 on: September 21, 2016, 04:02:34 PM »
It wants a relative path, I think that would be:

Code: [Select]
'../../wxgraphs/'
I don't know what old gauges is, maybe a link to WDL ? I doubt it will break anything.

Offline jensb

  • Posts: 249
  • Sweden
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 53.0.2785.116
    • Gudmundsbyn
Re: How to setup jpgraphs and wxgraphs
« Reply #407 on: September 21, 2016, 04:14:07 PM »
It wants a relative path, I think that would be:

Code: [Select]
'../../wxgraphs/'
I don't know what old gauges is, maybe a link to WDL ? I doubt it will break anything.

"It's Alive!!!"

http://www.gudmundsbyn.se/vader/steelseries/gauges-ss-basic.htm

Thanks for all the help & patience with a PHP n00b :)

Expect huge transfer of Karma points to your account ;)

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 27,850
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 51.0.2704.106
Re: How to setup jpgraphs and wxgraphs
« Reply #408 on: September 21, 2016, 04:18:49 PM »
Looking good  :D

Offline tronsdal

  • Posts: 1
  • OS/Browser:
  • Win NT 10.0
  • Chrome 59.0.3071.115
Re: How to setup jpgraphs and wxgraphs
« Reply #409 on: July 16, 2017, 08:33:39 PM »
Hi

I have a strange problem.

The Steel gauges looks allright with the graphs from wxgraphs in IE11 and MS Edge. But when browsing with Chrome or Safari, the graphs are not shown, and gauges disabled (marked false in gauges.js) are also displayed in Chrome and Safari. It seems like gauges.js is not read competely in Chrome and Safari.

See http://ovlinglia.com/wgauges/web_server/gauges-ss.htm

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 27,850
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 59.0.3071.115
Re: How to setup jpgraphs and wxgraphs
« Reply #410 on: July 16, 2017, 08:47:59 PM »
I don't see those problems, your gauges and graphs are working OK for me in Chrome.

Offline mcrossley

  • Posts: 646
  • Wilmslow, Cheshire, UK
    • none
  • OS/Browser:
  • Win NT 10.0
  • Chrome 59.0.3071.115
    • WilmslowAstro Weather
Re: How to setup jpgraphs and wxgraphs
« Reply #411 on: July 17, 2017, 09:56:52 AM »
Have you tried clearing the browser cache in Chrome and Safari?
Mark

Offline Nickji

  • Posts: 1
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 60.0.3112.91
Re: How to setup jpgraphs and wxgraphs
« Reply #412 on: September 20, 2017, 03:29:10 PM »
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
« Last Edit: September 20, 2017, 03:33:41 PM by Nickji »

Offline broadstairs

  • Stuart
  • Posts: 7,023
  • Broadstairs, Kent, UK
  • OS/Browser:
  • (Linux Mint)
  • Firefox 55.0
    • Broadstairs
Re: How to setup jpgraphs and wxgraphs
« Reply #413 on: September 20, 2017, 08:22:13 PM »
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

Offline broadstairs

  • Stuart
  • Posts: 7,023
  • Broadstairs, Kent, UK
  • OS/Browser:
  • (Linux Mint)
  • Firefox 55.0
    • Broadstairs
Re: How to setup jpgraphs and wxgraphs
« Reply #414 on: September 21, 2017, 07:21:11 AM »
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.

Code: [Select]
<?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

Offline broadstairs

  • Stuart
  • Posts: 7,023
  • Broadstairs, Kent, UK
  • OS/Browser:
  • (Linux Mint)
  • Firefox 55.0
    • Broadstairs
Re: How to setup jpgraphs and wxgraphs
« Reply #415 on: September 21, 2017, 08:26:00 AM »
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

Offline dsscheibe

  • Posts: 125
  • Phoenix, AZ
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Scotts Weather Station, Cactus Wren, Phoenix, Arizona
Re: How to setup jpgraphs and wxgraphs
« Reply #416 on: January 01, 2019, 01:24:58 AM »
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.

Scott
Davis Pro2 Plus daytime aspirated, wired
Weather Display


Offline niko

  • syzygy
  • Global Moderator
  • Posts: 27,850
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 71.0.3578.98
Re: How to setup jpgraphs and wxgraphs
« Reply #417 on: January 01, 2019, 02:11:12 AM »
#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.

Offline dsscheibe

  • Posts: 125
  • Phoenix, AZ
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Scotts Weather Station, Cactus Wren, Phoenix, Arizona
Re: How to setup jpgraphs and wxgraphs
« Reply #418 on: January 01, 2019, 02:48:09 AM »
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
Code: [Select]
<img src="baro_1hr.php" was something I did not know until I looked at the test page.
Scott
Davis Pro2 Plus daytime aspirated, wired
Weather Display


Offline saratogaWX

  • Global Moderator
  • Posts: 5,874
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Saratoga Weather
Re: How to setup jpgraphs and wxgraphs
« Reply #419 on: January 01, 2019, 03:18:07 AM »
WD doesn't provide separate graphs -- the JPGraph set of scripts are used to display the mouse-over graphs when Weather-Display is used.

Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates