Skip to content

Commit

Permalink
bug with 'auto' value for label adjustment patched for pie3d graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
f1mishutka committed Sep 14, 2022
1 parent 6415c9d commit 2112153
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/jpgraph_pie3d.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,11 +650,12 @@ function Pie3D($aaoption,$img,$data,$colors,$xc,$yc,$d,$angle,$z,
// Now print possible labels and add csim
$this->value->ApplyFont($img);
$margin = $img->GetFontHeight()/2 + $this->value->margin ;
$labelpoasadj = $this->ilabelposadj === 'auto' ? 1.0 : $this->ilabelposadj; //mitoteam: 'auto' can not be used as float
for($i=0; $i < count($data); ++$i ) {
$la = $labeldata[$i][0];
$x = $labeldata[$i][1] + cos($la*M_PI/180)*($d+$margin)*$this->ilabelposadj;
$y = $labeldata[$i][2] - sin($la*M_PI/180)*($h+$margin)*$this->ilabelposadj;
if( $this->ilabelposadj >= 1.0 ) {
$x = $labeldata[$i][1] + cos($la*M_PI/180)*($d+$margin)*$labelpoasadj;
$y = $labeldata[$i][2] - sin($la*M_PI/180)*($h+$margin)*$labelpoasadj;
if( $labelpoasadj >= 1.0 ) {
if( $la > 180 && $la < 360 ) $y += $z;
}
if( $this->labeltype == 0 ) {
Expand Down

0 comments on commit 2112153

Please sign in to comment.