Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Horizontal bar chart support #58

Merged
merged 3 commits into from
Dec 22, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"homepage": "http://phpoffice.github.io",
"type": "library",
"license": "LGPL",
"version": "0.2.0",
"authors": [
{
"name": "Mark Baker"
Expand Down
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