From e36d9513e1e0df5d75784e98e6ca4ae745ba27c9 Mon Sep 17 00:00:00 2001 From: AJRepo Date: Mon, 21 Aug 2023 09:53:06 -0500 Subject: [PATCH 1/4] Fix soft link in phplotdocs --- phplotdocs/phplot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phplotdocs/phplot.php b/phplotdocs/phplot.php index d1f0fee7..dde58ae8 120000 --- a/phplotdocs/phplot.php +++ b/phplotdocs/phplot.php @@ -1 +1 @@ -../phplot/phplot.php \ No newline at end of file +../src/phplot.php \ No newline at end of file From 898d6f446cf5bde12104a4e22d21f9ee60069f8b Mon Sep 17 00:00:00 2001 From: Foad Adeli <52503279+foadadeli@users.noreply.github.com> Date: Tue, 23 Apr 2024 15:54:56 +0330 Subject: [PATCH 2/4] Fix PHP 8.2 deprication warnings --- src/phplot.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/phplot.php b/src/phplot.php index e5b74658..93fa1e87 100644 --- a/src/phplot.php +++ b/src/phplot.php @@ -1908,7 +1908,7 @@ protected function ProcessTextGD($draw_it, $font, $angle, $x, $y, $color, $text, $y = $ypos - $r10 * $factor; // Call ImageString or ImageStringUp: - $draw_func($this->img, $font_number, $x, $y, $lines[$i], $color); + $draw_func($this->img, $font_number, (int)$x, (int)$y, $lines[$i], (int)$color); // Step to the next line of text. This is a rotation of (x=0, y=interline_spacing) $xpos += $r01 * $interline_step; @@ -7520,10 +7520,10 @@ protected function DrawLegend() // Draw color boxes: ImageFilledRectangle( $this->img, - $dot_left_x, - $y1, - $dot_right_x, - $y2, + (int) $dot_left_x, + (int) $y1, + (int) $dot_right_x, + (int) $y2, $this->ndx_data_colors[$color_index] ); // Draw a rectangle around the box, if enabled. @@ -8327,13 +8327,13 @@ protected function DrawPieChart() // Draw the slice ImageFilledArc( $this->img, - $xpos, - $ypos + $h, - $pie_width, - $pie_height, - $arc_end_angle, - $arc_start_angle, - $slicecol, + (int) $xpos, + (int) $ypos + $h, + (int) $pie_width, + (int) $pie_height, + (int) $arc_end_angle, + (int) $arc_start_angle, + (int) $slicecol, IMG_ARC_PIE ); @@ -10029,4 +10029,4 @@ protected function DrawError($error_message) } // PRS12: Move subclasses to separate files -// require_once 'phplot_truecolor.php'; +// require_once 'phplot_truecolor.php'; \ No newline at end of file From d21c89aea7cc418f378f3eaaa7438408df54ea7e Mon Sep 17 00:00:00 2001 From: Foad Adeli <52503279+foadadeli@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:24:50 +0330 Subject: [PATCH 3/4] Minor fixes --- src/phplot.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/phplot.php b/src/phplot.php index 93fa1e87..dc94f218 100644 --- a/src/phplot.php +++ b/src/phplot.php @@ -7533,7 +7533,14 @@ protected function DrawLegend() } else { $color = $this->ndx_text_color; } - ImageRectangle($this->img, $dot_left_x, $y1, $dot_right_x, $y2, $color); + ImageRectangle( + $this->img, + (int) $dot_left_x, + (int) $y1, + (int) $dot_right_x, + (int) $y2, + (int) $color + ); } } if (++$color_index > $max_color_index) { From 4eb0cbccff57423da2ffb8b8c5f7fa1049009f77 Mon Sep 17 00:00:00 2001 From: Foad Adeli <52503279+foadadeli@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:54:33 +0330 Subject: [PATCH 4/4] Minor fixes --- src/phplot.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/phplot.php b/src/phplot.php index dc94f218..b083e23e 100644 --- a/src/phplot.php +++ b/src/phplot.php @@ -7878,7 +7878,12 @@ protected function DrawBar( } else { // Suppress top shading (Note shade_top==FALSE && shade_side==FALSE is not allowed) $pts = array($x2, $y2, $x2, $y1, $x2 + $shade, $y1 - $shade, $x2 + $shade, $y2 - $shade); } - ImageFilledPolygon($this->img, $pts, count($pts) / 2, $shade_color); + + if (phpversion() > 8.0) { + ImageFilledPolygon($this->img, $pts, $shade_color); + } else { + ImageFilledPolygon($this->img, $pts, count($pts) / 2, $shade_color); + } } // Draw a border around the bar, if enabled.