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

writePlotAreaStyle() private method

private writePlotAreaStyle ( Chart $chart )
$chart PhpOffice\PhpPresentation\Shape\Chart
    private function writePlotAreaStyle(Chart $chart)
    {
        $chartType = $chart->getPlotArea()->getType();
        // style:style
        $this->xmlContent->startElement('style:style');
        $this->xmlContent->writeAttribute('style:name', 'stylePlotArea');
        $this->xmlContent->writeAttribute('style:family', 'chart');
        // style:text-properties
        $this->xmlContent->startElement('style:chart-properties');
        if ($chartType instanceof Bar3D) {
            $this->xmlContent->writeAttribute('chart:three-dimensional', 'true');
            $this->xmlContent->writeAttribute('chart:right-angled-axes', 'true');
        } elseif ($chartType instanceof Pie3D) {
            $this->xmlContent->writeAttribute('chart:three-dimensional', 'true');
            $this->xmlContent->writeAttribute('chart:right-angled-axes', 'true');
        }
        if ($chartType instanceof AbstractTypeBar) {
            $chartVertical = 'false';
            if ($chartType->getBarDirection() == AbstractTypeBar::DIRECTION_HORIZONTAL) {
                $chartVertical = 'true';
            }
            $this->xmlContent->writeAttribute('chart:vertical', $chartVertical);
            if ($chartType->getBarGrouping() == Bar::GROUPING_CLUSTERED) {
                $this->xmlContent->writeAttribute('chart:stacked', 'false');
                $this->xmlContent->writeAttribute('chart:overlap', '0');
            } elseif ($chartType->getBarGrouping() == Bar::GROUPING_STACKED) {
                $this->xmlContent->writeAttribute('chart:stacked', 'true');
                $this->xmlContent->writeAttribute('chart:overlap', '100');
            } elseif ($chartType->getBarGrouping() == Bar::GROUPING_PERCENTSTACKED) {
                $this->xmlContent->writeAttribute('chart:stacked', 'true');
                $this->xmlContent->writeAttribute('chart:overlap', '100');
                $this->xmlContent->writeAttribute('chart:percentage', 'true');
            }
        }
        $labelFormat = 'value';
        if ($chartType instanceof AbstractTypeBar) {
            if ($chartType->getBarGrouping() == Bar::GROUPING_PERCENTSTACKED) {
                $labelFormat = 'percentage';
            }
        }
        $this->xmlContent->writeAttribute('chart:data-label-number', $labelFormat);
        // > style:text-properties
        $this->xmlContent->endElement();
        // > style:style
        $this->xmlContent->endElement();
    }