private function getLegendProperty(LegendInterface $legend, $propertyName)
    {
        if ($legend->hasProperty($propertyName)) {
            $property = $legend->getProperty($propertyName);
        } else {
            $property = new Property($propertyName);
            $legend->addProperty($property);
        }

        return $property;
    }