Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Fix with PHP 7.2+
Browse files Browse the repository at this point in the history
  • Loading branch information
MHitMaN authored Nov 11, 2018
1 parent aec9183 commit 069a307
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/pChart/pData.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ function AddPoint($Value, $Serie = "Serie1", $Description = "")
$Value = $Value[0];

$ID = 0;
for ($i = 0; $i <= count($this->Data); $i++) {
if (isset($this->Data[$i][$Serie])) {
$ID = $i + 1;
}
}
if ( is_array( $this->Data ) ) {
for ( $i = 0; $i <= count( $this->Data ); $i ++ ) {
if ( isset( $this->Data[ $i ][ $Serie ] ) ) {
$ID = $i + 1;
}
}
}

if (count($Value) == 1) {
$this->Data[$ID][$Serie] = $Value;
Expand Down Expand Up @@ -203,4 +205,4 @@ function GetDataDescription()
}
}

?>
?>

0 comments on commit 069a307

Please sign in to comment.