Skip to content

Commit

Permalink
Update pScatter.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Momchil Bozhinov committed Nov 1, 2019
1 parent 9e6fcfa commit 19bf428
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pChart/pScatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -793,15 +793,15 @@ public function drawScatterBestFit(array $Format = [])
}

$n = count($PosArrayX);
if ((($n * $Sxx) == ($Sx * $Sx))) {
$X1 = $this->getPosArraySingle($XAxisData["ScaleMin"], $XAxisData);
if ((($n * $Sxx) == ($Sx * $Sx))) { # Momchil: No example goes in here
$X1 = $GraphAreaCoordinates['L'] + $XAxisData["Margin"];
$X2 = $X1;
$Y1 = $GraphAreaCoordinates["T"];
$Y2 = $GraphAreaCoordinates["B"];
} else {
$M = (($n * $Sxy) - ($Sx * $Sy)) / (($n * $Sxx) - ($Sx * $Sx));
$B = (($Sy) - ($M * $Sx)) / ($n);
$X1 = $this->getPosArraySingle($XAxisData["ScaleMin"], $XAxisData);
$X1 = $GraphAreaCoordinates['L'] + $XAxisData["Margin"];
$Y1 = $this->getPosArraySingle($M * $XAxisData["ScaleMin"] + $B, $YAxisData);
$X2 = $this->getPosArraySingle($XAxisData["ScaleMax"], $XAxisData);
$Y2 = $this->getPosArraySingle($M * $XAxisData["ScaleMax"] + $B, $YAxisData);
Expand Down

0 comments on commit 19bf428

Please sign in to comment.