/**
  * Render a legend
  * 
  * @param ezcGraphRenderer $renderer Renderer
  * @param ezcGraphBoundings $boundings Boundings for the axis
  * @return ezcGraphBoundings Remaining boundings
  */
 public function render(ezcGraphRenderer $renderer, ezcGraphBoundings $boundings)
 {
     $boundings = $this->calculateBoundings($boundings);
     if ($this->position === ezcGraph::LEFT || $this->position === ezcGraph::RIGHT) {
         $type = ezcGraph::VERTICAL;
     } else {
         $type = ezcGraph::HORIZONTAL;
     }
     // Render standard elements
     $this->properties['boundings'] = $renderer->drawBox($this->properties['boundings'], $this->properties['background'], $this->properties['border'], $this->properties['borderWidth'], $this->properties['margin'], $this->properties['padding'], $this->properties['title'], $this->getTitleSize($this->properties['boundings'], $type));
     // Render legend
     $renderer->drawLegend($this->boundings, $this, $type);
     return $boundings;
 }