PhpOffice\PhpPresentation\Tests\Writer\ODPresentation\ObjectsChartTest::testTypeBarGroupingStacked PHP Method

testTypeBarGroupingStacked() public method

    public function testTypeBarGroupingStacked()
    {
        $oBar = new Bar();
        $oBar->addSeries(new Series('Series', array('Jan' => 1, 'Feb' => 5, 'Mar' => 2)));
        $oBar->setBarGrouping(Bar::GROUPING_STACKED);
        $phpPresentation = new PhpPresentation();
        $oSlide = $phpPresentation->getActiveSlide();
        $oChart = $oSlide->createChartShape();
        $oChart->getPlotArea()->setType($oBar);
        $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation');
        $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'stylePlotArea\']/style:chart-properties';
        $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml'));
        $this->assertEquals('true', $pres->getElementAttribute($element, 'chart:stacked', 'Object 1/content.xml'));
        $this->assertEquals('100', $pres->getElementAttribute($element, 'chart:overlap', 'Object 1/content.xml'));
        $this->assertFalse($pres->attributeElementExists($element, 'chart:percentage', 'Object 1/content.xml'));
        $this->assertEquals('value', $pres->getElementAttribute($element, 'chart:data-label-number', 'Object 1/content.xml'));
    }