Skip to content

Commit

Permalink
Merge pull request #58 from rdoepke/master
Browse files Browse the repository at this point in the history
Horizontal bar chart support
  • Loading branch information
Progi1984 committed Dec 22, 2014
2 parents 30957a4 + bdef144 commit 871c1c0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions src/PhpPowerpoint/Shape/Chart/Type/Bar3D.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,39 @@
*/
class Bar3D extends AbstractType implements ComparableInterface
{
/** Orientation of bars */
const DIRECTION_VERTICAL = 'col';
const DIRECTION_HORIZONTAL = 'bar';

/**
* Orientation of bars
*
* @var string
*/
protected $barDirection = self::DIRECTION_VERTICAL;

/**
* Set bar orientation
*
* @param string $value
* @return \PhpOffice\PhpPowerpoint\Shape\Chart\Type\Bar3D
*/
public function setBarDirection($value = self::DIRECTION_VERTICAL)
{
$this->barDirection = $value;
return $this;
}

/**
* Get orientation
*
* @return string
*/
public function getBarDirection()
{
return $this->barDirection;
}

/**
* Get hash code
*
Expand Down
2 changes: 1 addition & 1 deletion src/PhpPowerpoint/Writer/PowerPoint2007/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ protected function writeTypeBar3D(XMLWriter $objWriter, Bar3D $subject, $include

// c:barDir
$objWriter->startElement('c:barDir');
$objWriter->writeAttribute('val', 'col');
$objWriter->writeAttribute('val', $subject->getBarDirection());
$objWriter->endElement();

// c:grouping
Expand Down

0 comments on commit 871c1c0

Please sign in to comment.