src/DataDefinition/Palette/Builder/PaletteBuilder.php
public function createLegend($name)
    {
        if ($this->legend) {
            $this->finishLegend();
        }

        $legend = $this->legendClass->newInstance($name);

        $event = new CreateLegendEvent($legend, $this);
        $this->dispatchEvent($event);
        $this->legend = $event->getLegend();

        return $this;
    }
public function createLegend($name)
    {
        if ($this->legend) {
            $this->finishLegend();
        }

        $legend = $this->legendClass->newInstance($name);

        $event = new CreateLegendEvent($legend, $this);
        $this->dispatchEvent($event);
        $this->legend = $event->getLegend();

        return $this;
    }
public function createLegend ( $ name ) { if ( $ this -> legend ) { $ this -> finishLegend ( ) ; } $ legend = $ this -> legendClass -> newInstance ( $ name ) ; $ event = new CreateLegendEvent ( $ legend , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ this -> legend = $ event -> getLegend ( ) ; return $ this ; }
Start a new legend.

@param string $name Name of the legend.

@return PaletteBuilder
Start a new legend .