Graph::ContrastText PHP Method

ContrastText() protected method

Displays high-contrast text
protected ContrastText ( $x, $y, $text, $fcolour = 'black', $bcolour = 'white', $properties = NULL, $styles = NULL )
    protected function ContrastText($x, $y, $text, $fcolour = 'black', $bcolour = 'white', $properties = NULL, $styles = NULL)
    {
        $props = array('transform' => 'translate(' . $x . ',' . $y . ')', 'fill' => $fcolour);
        if (is_array($properties)) {
            $props = array_merge($properties, $props);
        }
        $bg = $this->Element('text', array('stroke-width' => '2px', 'stroke' => $bcolour), NULL, $text);
        $fg = $this->Element('text', NULL, NULL, $text);
        return $this->Element('g', $props, $styles, $bg . $fg);
    }