Using version 10.2.4, I get errors like
[13-Feb-2023 11:41:45 America/New_York] PHP Deprecated: Implicit conversion from float 130118.00000000001 to int loses precision in /home/httpd/vhosts/
ratingscentral.com/httpdocs/Libraries/jpgraph.php on line 1409
[13-Feb-2023 11:59:53 America/New_York] PHP Deprecated: Implicit conversion from float 512511.00000000006 to int loses precision in /home/httpd/vhosts/
ratingscentral.com/httpdocs/Libraries/jpgraph.php on line 1409
The problem is the line
srand ((double) microtime() * 1000000);
According to the PHP docs, it is not necessary to call srand. So, I just commented it out.
What is the relationship between version 10.2.4 and version 4.4.1? Is 10.2.4 a beta for 4.4.2?
Here are some other changes I make to the source (I'm targeting HTML5):
jpgraph.php
function GetHTMLImageMap($aMapName) {
// $im = "<map name=\"$aMapName\" id=\"$aMapName\" >\n"; // Commented.
$im = '<map name="' . $aMapName . '">'; // Added.
function GetCSIMImgHTML($aCSIMName, $aScriptName='auto', $aBorder=0 ) {
if( $aScriptName=='auto' ) {
$aScriptName=basename($_SERVER['PHP_SELF']);
}
$urlarg = $this->GetURLArguments(true);
// return "<img src=\"".$aScriptName.'?'.$urlarg."\" ismap=\"ismap\" usemap=\"#".$aCSIMName.'" height="'.$this->img->height."\" alt=\"".$this->iCSIMImgAlt."\" />\n"; // Commented.
return '<img src="'.$aScriptName.'?'.$urlarg.'" usemap="#'.$aCSIMName.'" width="'.$this->img->width.'" height="'.$this->img->height.'" alt="'.$this->iCSIMImgAlt.'">'; // Added.
jpgraph_plotmark.inc.php
function AddCSIMCircle($x,$y,$r) {
...
if( !empty($this->csimalt) ) {
$tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue);
// $this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; // Commented.
$this->csimareas .= " title=\"$tmp\" alt=\"$tmp\""; // Added.
}
// $this->csimareas .= " />\n"; // DJM: commented.
$this->csimareas .= '>'; // DJM: added.
I don't want labels on the top axis, but this doesn't seem to be an opion. So
jpgraph.php
function StrokeAxis($aStrokeLabels=true) {
...
// $this->xaxis->Stroke($this->yscale,$aStrokeLabels); // Commented.
$this->xaxis->Stroke($this->yscale,false); // Added.
David