public function render($size, array $parts)
    {
        ArgumentChecker::check($size, 'integer');

        $this->calculateTotal($parts);
        $this->size = $size;
        $this->parts = $parts;

        $r = '';

        foreach ($parts as $color => $x) {
            $bars = $this->valueToBars($x);
            $r .= $this->colorSpaces($bars, $color);
        }

        $r = $this->fillToSize($r);

        return $r;
    }
public function render($size, array $parts)
    {
        ArgumentChecker::check($size, 'integer');

        $this->calculateTotal($parts);
        $this->size = $size;
        $this->parts = $parts;

        $r = '';

        foreach ($parts as $color => $x) {
            $bars = $this->valueToBars($x);
            $r .= $this->colorSpaces($bars, $color);
        }

        $r = $this->fillToSize($r);

        return $r;
    }
public function render ( $ size , array $ parts ) { ArgumentChecker :: check ( $ size , 'integer' ) ; $ this -> calculateTotal ( $ parts ) ; $ this -> size = $ size ; $ this -> parts = $ parts ; $ r = '' ; foreach ( $ parts as $ color => $ x ) { $ bars = $ this -> valueToBars ( $ x ) ; $ r .= $ this -> colorSpaces ( $ bars , $ color ) ; } $ r = $ this -> fillToSize ( $ r ) ; return $ r ; }
Render the progress bar.

@param  integer $size The width (in column/characters of the progress
bar).
@param  array   $parts The individual [color => value] that make up the
progress bar.
@return string
Render the progress bar .