app/Module/StatisticsChartModule.php
private function axisYears(string $boundaries_csv): array
    {
        $boundaries = explode(',', $boundaries_csv);

        $axis = [];
        foreach ($boundaries as $n => $boundary) {
            if ($n === 0) {
                $date = new Date('BEF ' . $boundary);
            } else {
                $date = new Date('BET ' . $boundaries[$n - 1] . ' AND ' . ($boundary - 1));
            }
            $axis[$boundary - 1] = strip_tags($date->display());
        }

        $date              = new Date('AFT ' . $boundaries[count($boundaries) - 1]);
        $axis[PHP_INT_MAX] = strip_tags($date->display());

        return $axis;
    }
private function axisYears(string $boundaries_csv): array
    {
        $boundaries = explode(',', $boundaries_csv);

        $axis = [];
        foreach ($boundaries as $n => $boundary) {
            if ($n === 0) {
                $date = new Date('BEF ' . $boundary);
            } else {
                $date = new Date('BET ' . $boundaries[$n - 1] . ' AND ' . ($boundary - 1));
            }
            $axis[$boundary - 1] = strip_tags($date->display());
        }

        $date              = new Date('AFT ' . $boundaries[count($boundaries) - 1]);
        $axis[PHP_INT_MAX] = strip_tags($date->display());

        return $axis;
    }
private function axisYears ( string $ boundaries_csv ) : array { $ boundaries = explode ( ',' , $ boundaries_csv ) ; $ axis = [ ] ; foreach ( $ boundaries as $ n => $ boundary ) { if ( $ n === 0 ) { $ date = new Date ( 'BEF ' . $ boundary ) ; } else { $ date = new Date ( 'BET ' . $ boundaries [ $ n - 1 ] . ' AND ' . ( $ boundary - 1 ) ) ; } $ axis [ $ boundary - 1 ] = strip_tags ( $ date -> display ( ) ) ; } $ date = new Date ( 'AFT ' . $ boundaries [ count ( $ boundaries ) - 1 ] ) ; $ axis [ PHP_INT_MAX ] = strip_tags ( $ date -> display ( ) ) ; return $ axis ; }
Convert a list of N year-boundaries into N+1 year-ranges for the z-axis.

@param string $boundaries_csv

@return string[]
Convert a list of N year - boundaries into N + 1 year - ranges for the z - axis .