PhpOffice\PhpPresentation\Writer\ODPresentation\ObjectsChart::writeGridlineStyle PHP Method

writeGridlineStyle() protected method

protected writeGridlineStyle ( Gridlines $oGridlines, string $styleName )
$oGridlines PhpOffice\PhpPresentation\Shape\Chart\Gridlines
$styleName string
    protected function writeGridlineStyle($oGridlines, $styleName)
    {
        if (!$oGridlines instanceof Chart\Gridlines) {
            return;
        }
        // style:style
        $this->xmlContent->startElement('style:style');
        $this->xmlContent->writeAttribute('style:name', $styleName);
        $this->xmlContent->writeAttribute('style:family', 'chart');
        // style:style > style:graphic-properties
        $this->xmlContent->startElement('style:graphic-properties');
        $this->xmlContent->writeAttribute('svg:stroke-width', number_format(CommonDrawing::pointsToCentimeters($oGridlines->getOutline()->getWidth()), 2, '.', '') . 'cm');
        $this->xmlContent->writeAttribute('svg:stroke-color', '#' . $oGridlines->getOutline()->getFill()->getStartColor()->getRGB());
        $this->xmlContent->endElement();
        // ##style:style
        $this->xmlContent->endElement();
    }