@@ -666,4 +666,56 @@ public function testTypeScatterSeriesOutline()
666
666
$ this ->assertZipXmlAttributeExists ('Object 1/content.xml ' , $ expectedElement , 'svg:stroke-color ' );
667
667
$ this ->assertZipXmlAttributeEquals ('Object 1/content.xml ' , $ expectedElement , 'svg:stroke-color ' , '# ' . $ oColor ->getRGB ());
668
668
}
669
+
670
+ public function testSeries ()
671
+ {
672
+ $ oSeries = new Series ('Series ' , array ('Jan ' => 1 , 'Feb ' => 5 , 'Mar ' => 2 ));
673
+ $ oPie = new Pie ();
674
+ $ oPie ->addSeries ($ oSeries );
675
+ $ oChart = $ this ->oPresentation ->getActiveSlide ()->createChartShape ();
676
+ $ oChart ->getPlotArea ()->setType ($ oPie );
677
+
678
+ $ element = '/office:document-content/office:automatic-styles/style:style[@style:name= \'styleSeries0 \']/style:chart-properties ' ;
679
+
680
+ // $showCategoryName = false / $showPercentage = false / $showValue = true
681
+ $ this ->assertZipXmlElementExists ('Object 1/content.xml ' , $ element );
682
+ $ this ->assertZipXmlAttributeExists ('Object 1/content.xml ' , $ element , 'chart:data-label-number ' );
683
+ $ this ->assertZipXmlAttributeEquals ('Object 1/content.xml ' , $ element , 'chart:data-label-number ' , 'value ' );
684
+ $ this ->assertZipXmlAttributeNotExists ('Object 1/content.xml ' , $ element , 'chart:data-label-text ' );
685
+
686
+ $ oSeries ->setShowValue (false );
687
+ $ this ->resetPresentationFile ();
688
+
689
+ // $showCategoryName = false / $showPercentage = false / $showValue = false
690
+ $ this ->assertZipXmlElementExists ('Object 1/content.xml ' , $ element );
691
+ $ this ->assertZipXmlAttributeNotExists ('Object 1/content.xml ' , $ element , 'chart:data-label-number ' );
692
+ $ this ->assertZipXmlAttributeNotExists ('Object 1/content.xml ' , $ element , 'chart:data-label-text ' );
693
+
694
+ // $showCategoryName = false / $showPercentage = true / $showValue = true
695
+ $ oSeries ->setShowValue (true );
696
+ $ oSeries ->setShowPercentage (true );
697
+ $ this ->resetPresentationFile ();
698
+
699
+ $ this ->assertZipXmlElementExists ('Object 1/content.xml ' , $ element );
700
+ $ this ->assertZipXmlAttributeExists ('Object 1/content.xml ' , $ element , 'chart:data-label-number ' );
701
+ $ this ->assertZipXmlAttributeEquals ('Object 1/content.xml ' , $ element , 'chart:data-label-number ' , 'value-and-percentage ' );
702
+ $ this ->assertZipXmlAttributeNotExists ('Object 1/content.xml ' , $ element , 'chart:data-label-text ' );
703
+
704
+ // $showCategoryName = false / $showPercentage = true / $showValue = false
705
+ $ oSeries ->setShowValue (false );
706
+ $ this ->resetPresentationFile ();
707
+
708
+ $ this ->assertZipXmlElementExists ('Object 1/content.xml ' , $ element );
709
+ $ this ->assertZipXmlAttributeExists ('Object 1/content.xml ' , $ element , 'chart:data-label-number ' );
710
+ $ this ->assertZipXmlAttributeEquals ('Object 1/content.xml ' , $ element , 'chart:data-label-number ' , 'percentage ' );
711
+ $ this ->assertZipXmlAttributeNotExists ('Object 1/content.xml ' , $ element , 'chart:data-label-text ' );
712
+
713
+ // $showCategoryName = false / $showPercentage = true / $showValue = false
714
+ $ oSeries ->setShowCategoryName (true );
715
+ $ this ->resetPresentationFile ();
716
+
717
+ $ this ->assertZipXmlElementExists ('Object 1/content.xml ' , $ element );
718
+ $ this ->assertZipXmlAttributeExists ('Object 1/content.xml ' , $ element , 'chart:data-label-text ' );
719
+ $ this ->assertZipXmlAttributeEquals ('Object 1/content.xml ' , $ element , 'chart:data-label-text ' , 'true ' );
720
+ }
669
721
}
0 commit comments