From 5b688d50d82cf491b6114e94bc84de59dc96941d Mon Sep 17 00:00:00 2001 From: troosan Date: Sun, 2 Dec 2018 23:54:25 +0100 Subject: [PATCH] fix formatting --- src/PhpWord/Style/Chart.php | 26 +++++++++++++--------- src/PhpWord/Writer/Word2007/Part/Chart.php | 16 ++++++------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/PhpWord/Style/Chart.php b/src/PhpWord/Style/Chart.php index 5c96afd2..06b4829c 100644 --- a/src/PhpWord/Style/Chart.php +++ b/src/PhpWord/Style/Chart.php @@ -51,8 +51,8 @@ class Chart extends AbstractStyle * @var array */ private $colors = array(); - - /** + + /** * Chart title * * @var string @@ -111,9 +111,15 @@ class Chart extends AbstractStyle */ private $valueAxisTitle; + /** + * The position for major tick marks + * Possible values are 'in', 'out', 'cross', 'none' + * + * @var string + */ private $majorTickMarkPos = 'none'; - /* + /** * Show labels for axis * * @var bool @@ -234,7 +240,7 @@ class Chart extends AbstractStyle return $this; } - + /** * Get the chart title * @@ -248,7 +254,7 @@ class Chart extends AbstractStyle /** * Set the chart title * - * @param string $value + * @param string $value */ public function setTitle($value = null) { @@ -262,7 +268,7 @@ class Chart extends AbstractStyle * * @return bool */ - public function getShowLegend() + public function isShowLegend() { return $this->showLegend; } @@ -270,7 +276,7 @@ class Chart extends AbstractStyle /** * Set chart legend visibility * - * @param bool $value + * @param bool $value */ public function setShowLegend($value = false) { @@ -452,8 +458,8 @@ class Chart extends AbstractStyle } /** - * set the position for major tick marks - * @param string $position [description] + * Set the position for major tick marks + * @param string $position */ public function setMajorTickPosition($position) { @@ -461,7 +467,7 @@ class Chart extends AbstractStyle $this->majorTickMarkPos = $this->setEnumVal($position, $enum, $this->majorTickMarkPos); } - /* + /** * Show Gridlines for X-Axis * * @return bool diff --git a/src/PhpWord/Writer/Word2007/Part/Chart.php b/src/PhpWord/Writer/Word2007/Part/Chart.php index e14a708b..812d3bf1 100644 --- a/src/PhpWord/Writer/Word2007/Part/Chart.php +++ b/src/PhpWord/Writer/Word2007/Part/Chart.php @@ -128,12 +128,12 @@ class Chart extends AbstractPart $type = $this->element->getType(); $style = $this->element->getStyle(); $this->options = $this->types[$type]; - - $title = $style->getTitle(); - $showLegend = $style->getShowLegend(); + + $title = $style->getTitle(); + $showLegend = $style->isShowLegend(); //Chart title - if($title){ + if ($title) { $xmlWriter->startElement('c:title'); $xmlWriter->startElement('c:tx'); $xmlWriter->startElement('c:rich'); @@ -142,20 +142,18 @@ class Chart extends AbstractPart - '.$title.' + ' . $title . ' '); - $xmlWriter->endElement(); // c:rich $xmlWriter->endElement(); // c:tx $xmlWriter->endElement(); // c:title - - }else{ + } else { $xmlWriter->writeElementBlock('c:autoTitleDeleted', 'val', 1); } //Chart legend - if($showLegend){ + if ($showLegend) { $xmlWriter->writeRaw(''); }