src/Reporter/Text.php
public function chart()
    {
        $result = '';

        $ranking = $this->_benchmark->matrix()->ranking();

        $maxLength = 0;

        $maxRate = 0;

        foreach($ranking as $task) {
            if ($task->failed()) {
                continue;
            }
            if ($task->rate() > $maxRate){
                $maxRate = $task->rate();
            }
            if (mb_strlen($task->name()) > $maxLength){
                $maxLength = mb_strlen($task->name());
            }
        }

        foreach($ranking as $task) {
            $name = $task->name();
            $result .= $this->mb_str_pad($name, $maxLength, ' ', STR_PAD_RIGHT);

            if ($task->failed()) {
                $ratio = 0;
                $result .= $this->mb_str_pad('x', 10);
            } else {
                $rate = $task->rate();
                $ratio = ($rate / $maxRate);
                $result .= $this->mb_str_pad(round($ratio*100) . '%', 10);
            }
            $result .= ' | ';

            $width = 60;
            $chars = (int) ($width * $ratio);
            $result .= str_repeat('█', $chars);
            $result .= str_repeat(' ', $width - $chars );
            $result .= "  |\n";
        }
        return $result;
    }
public function chart()
    {
        $result = '';

        $ranking = $this->_benchmark->matrix()->ranking();

        $maxLength = 0;

        $maxRate = 0;

        foreach($ranking as $task) {
            if ($task->failed()) {
                continue;
            }
            if ($task->rate() > $maxRate){
                $maxRate = $task->rate();
            }
            if (mb_strlen($task->name()) > $maxLength){
                $maxLength = mb_strlen($task->name());
            }
        }

        foreach($ranking as $task) {
            $name = $task->name();
            $result .= $this->mb_str_pad($name, $maxLength, ' ', STR_PAD_RIGHT);

            if ($task->failed()) {
                $ratio = 0;
                $result .= $this->mb_str_pad('x', 10);
            } else {
                $rate = $task->rate();
                $ratio = ($rate / $maxRate);
                $result .= $this->mb_str_pad(round($ratio*100) . '%', 10);
            }
            $result .= ' | ';

            $width = 60;
            $chars = (int) ($width * $ratio);
            $result .= str_repeat('█', $chars);
            $result .= str_repeat(' ', $width - $chars );
            $result .= "  |\n";
        }
        return $result;
    }
Returns the bar chart.

@return string The bar chart.