It took a bit of digging, but found the magic sauce to get both JPgraph 4.4.0 and 4.4.1 to work on PHP 8.1/8.2 (and likely on PHP 8.0).
Edit {jpgraphdirectory}/src/jpgraph.php
function _phpErrorHandler($errno,$errmsg,$filename, $linenum, $vars) {
to
function _phpErrorHandler($errno,$errmsg,$filename, $linenum) {
and
class LinearTicks extends Ticks {
public $minor_step=1, $major_step=2;
public $xlabel_offset=0,$xtick_offset=0;
to
class LinearTicks extends Ticks {
public $minor_step=1, $major_step=2;
public $ticks_label;
public $xlabel_offset=0,$xtick_offset=0;
The first fix addresses that the callback function for set_error_handler() removed a prior 5th argument in PHP8.0 (was deprecated in PHP 7.2.0) yielding a Fatal error (wrong number of arguments) with the original code.
The second fix addresses an issue on line 4442 where $this->ticks_label wasn't declared so cast an error.
With these fixes, the sunposa.php script works just fine on either JPgraph version.