cloudy cloudy

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

0 Members and 1 Guest are viewing this topic.

Offline jensb

  • Posts: 245
  • 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,427
  • 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: 245
  • 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,427
  • 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,427
  • 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: 638
  • 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,009
  • 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,009
  • 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,009
  • 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

 

cumulus