Beispiel #1
0
 public function testSize()
 {
     $object = new Marker();
     $value = rand(1, 100);
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Marker', $object->setSize($value));
     $this->assertEquals($value, $object->getSize());
 }
Beispiel #2
0
 /**
  * @param XMLWriter $objWriter
  * @param Chart\Marker $oMarker
  */
 protected function writeSeriesMarker(XMLWriter $objWriter, Chart\Marker $oMarker)
 {
     if ($oMarker->getSymbol() != Chart\Marker::SYMBOL_NONE) {
         $markerSize = (int) $oMarker->getSize();
         if ($markerSize < 2) {
             $markerSize = 2;
         }
         if ($markerSize > 72) {
             $markerSize = 72;
         }
         // c:marker
         $objWriter->startElement('c:marker');
         // c:marker > c:symbol
         $objWriter->startElement('c:symbol');
         $objWriter->writeAttribute('val', $oMarker->getSymbol());
         $objWriter->endElement();
         /**
          * c:marker > c:size
          * Size in points
          * @link : https://msdn.microsoft.com/en-us/library/hh658135(v=office.12).aspx
          */
         $objWriter->startElement('c:size');
         $objWriter->writeAttribute('val', $markerSize);
         $objWriter->endElement();
         $objWriter->endElement();
     }
 }