diff --git a/src/PhpPresentation/Shape/Chart/Axis.php b/src/PhpPresentation/Shape/Chart/Axis.php index e9433da7c..ccc351e6d 100644 --- a/src/PhpPresentation/Shape/Chart/Axis.php +++ b/src/PhpPresentation/Shape/Chart/Axis.php @@ -34,6 +34,11 @@ class Axis implements ComparableInterface const TICK_MARK_INSIDE = 'in'; const TICK_MARK_OUTSIDE = 'out'; + const TICK_LABEL_POS_NEXT_TO = 'nextTo'; + const TICK_LABEL_POS_HIGH = 'high'; + const TICK_LABEL_POS_LOW = 'low'; + const TICK_LABEL_POS_NONE = 'none'; + /** * Title * @@ -105,6 +110,11 @@ class Axis implements ComparableInterface */ protected $isVisible = true; + /** + * @var string + */ + protected $tickLabelPos = self::TICK_LABEL_POS_NEXT_TO; + /** * Create a new \PhpOffice\PhpPresentation\Shape\Chart\Axis instance * @@ -348,6 +358,16 @@ public function setOutline(Outline $outline) return $this; } + public function getTickLabelPos() + { + return $this->tickLabelPos; + } + + public function setTickLabelPos($pos = self::TICK_LABEL_POS_NEXT_TO) + { + $this->tickLabelPos = $pos; + return $this; + } /** * Get hash code * diff --git a/src/PhpPresentation/Shape/Chart/Series.php b/src/PhpPresentation/Shape/Chart/Series.php index 73cd03d4f..c60f835e9 100644 --- a/src/PhpPresentation/Shape/Chart/Series.php +++ b/src/PhpPresentation/Shape/Chart/Series.php @@ -21,6 +21,7 @@ use PhpOffice\PhpPresentation\Style\Fill; use PhpOffice\PhpPresentation\Style\Font; use PhpOffice\PhpPresentation\Style\Outline; +use PhpOffice\PhpPresentation\Style\Color as StyleColor; /** * \PhpOffice\PhpPresentation\Shape\Chart\Series @@ -132,6 +133,11 @@ class Series implements ComparableInterface */ private $values = array(); + /** + * Label color + * @var StyleColor + */ + private $labelColor = null; /** * Hash index * @var string @@ -509,6 +515,16 @@ public function setLabelPosition($value) return $this; } + public function getLabelColor() + { + return $this->labelColor; + } + public function setLabelColor($labelColor = null) + { + $this->labelColor = $labelColor; + return $this; + } + /** * @return Marker */ diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php b/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php index 7109881c6..1260c21c1 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php @@ -860,6 +860,14 @@ protected function writeTypeBar(XMLWriter $objWriter, Bar $subject, $includeShee $objWriter->writeAttribute('sourceLinked', '0'); $objWriter->endElement(); } + if ($series->getLabelColor() != null) { + $objWriter->startElement('c:spPr'); + $objWriter->startElement('a:solidFill'); + $this->writeColor($objWriter, $series->getLabelColor()); + $objWriter->endElement(); + $objWriter->endElement(); + } + // c:txPr $objWriter->startElement('c:txPr'); @@ -1786,6 +1794,9 @@ protected function writeTypeLine(XMLWriter $objWriter, Line $subject, $includeSh $objWriter->endElement(); + // c:dLblPos + $this->writeElementWithValAttribute($objWriter, 'c:dLblPos', $series->getLabelPosition()); + // c:showVal $this->writeElementWithValAttribute($objWriter, 'c:showVal', $series->hasShowValue() ? '1' : '0'); @@ -2277,7 +2288,8 @@ protected function writeAxis(XMLWriter $objWriter, Chart\Axis $oAxis, $typeAxis, // c:tickLblPos $objWriter->startElement('c:tickLblPos'); - $objWriter->writeAttribute('val', 'nextTo'); + $objWriter->writeAttribute('val', $oAxis->getTickLabelPos()); + //$objWriter->writeAttribute('val', 'nextTo'); $objWriter->endElement(); // c:spPr