points[$x])) { $this->points[$x] = 0; } // store old y-value for displaying the actual (non-aggregated) // value in the tooltip $point[2] = $point[1]; $this->points[$x] += $point[1]; $point[1] = $this->points[$x]; } } /** * Add a graph to the stack * * @param $graph */ public function addToStack($graph) { $this->stack[] = $graph; } /** * Empty the stack * * @return bool */ public function stackEmpty() { return empty($this->stack); } /** * Render this stack in the correct order * * @param RenderContext $ctx The context to use for rendering * * @return DOMElement The SVG representation of this graph */ public function toSvg(RenderContext $ctx) { $group = $ctx->getDocument()->createElement('g'); $renderOrder = array_reverse($this->stack); foreach ($renderOrder as $stackElem) { $group->appendChild($stackElem->toSvg($ctx)); } return $group; } }