Author Topic: Steel Gauges pop up graphs and PHP7  (Read 1874 times)

0 Members and 1 Guest are viewing this topic.

Offline RickNY

  • Contributor
  • ***
  • Posts: 116
    • College Hills Weather - Farmingville, NY
Steel Gauges pop up graphs and PHP7
« on: October 31, 2016, 10:42:45 AM »
I just switched web hosting from Hostway over to 1and1.. For the most part, the move went smoothly.. I had to make some changes because on Hostway, my site was using PHP 5.2, and on 1and1, I'm using PHP 7.0.12.  I think I have just about everything working again, but one thing that seems to have broken is the mouse-over line graphs using in the Steel Gauges at http://www.indigopc.com/wxssgauges.php .. One of the other graphs do work -- the average wind direction one.  PHP is throwing this on the line graphs though:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; LinePlot has a deprecated constructor in /homepages/xx/xxxxxxxx/htdocs/jpgraph/src/jpgraph_line.php on line 24

I also updated jpgraph to 4.0.1 so that would be compatible with PHP 7.  In jpgraph_line.php in its downloaded form, Line 38 defines the method "LinePlot", which is the same name as the class:

Code: [Select]
function LinePlot($datay,$datax=false) {
To fix this, I changed this line to:

Code: [Select]
public function __construct($datay,$datax=false) {
That lets the line graphs work again.. Just wanted to know if this is correct for this particular situation.. I'm guessing the jpgraph author may have missed something with PHP 7 compatibility?

Thanks,
Rick

http://www.indigopc.com

Offline orion_jb2001

  • Member
  • *
  • Posts: 42
Re: Steel Gauges pop up graphs and PHP7
« Reply #1 on: November 27, 2017, 05:53:10 PM »
I just switched web hosting from Hostway over to 1and1.. For the most part, the move went smoothly.. I had to make some changes because on Hostway, my site was using PHP 5.2, and on 1and1, I'm using PHP 7.0.12.  I think I have just about everything working again, but one thing that seems to have broken is the mouse-over line graphs using in the Steel Gauges at http://www.indigopc.com/wxssgauges.php .. One of the other graphs do work -- the average wind direction one.  PHP is throwing this on the line graphs though:



Just getting involved in Steel Gauges, impressed with them, but want to incorporate the graph details.  Is there a definitive step by step or a download, to get the graphs to show detail.  :) http://www.jeffbartlett.org/test/gauges-ss-basic.htm

Jeff
« Last Edit: November 28, 2017, 05:38:00 AM by orion_jb2001 »

Offline mcrossley

  • Forecaster
  • *****
  • Posts: 1128
    • Wilmslow Astro
Re: Steel Gauges pop up graphs and PHP7
« Reply #2 on: November 28, 2017, 04:14:08 AM »

Just getting involved in Steel Gauges, impressed with them, but want to incorporate the graph details.  Is there a definitive step by step or a download, to get the graphs to show detail.  The pop ups are working on mine but havent got any data showing. http://www.jeffbartlett.org/test/gauges-ss-basic.htm  :)

Jeff
Jeff, not an answer to your question, but do you know your website allows directory browsing? (try http://www.jeffbartlett.org/)
You probably want to to disable that.
Mark

Offline orion_jb2001

  • Member
  • *
  • Posts: 42
Re: Steel Gauges pop up graphs and PHP7
« Reply #3 on: November 28, 2017, 05:37:04 AM »
Hi Mark,

Thanks for pointing that out fixed now I think.

Jeff

 

anything