Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

--Added 3 new classes: PHPExcel_Chart_Axis, PHPExcel_Chart_GridLines, PH... #404

Merged
merged 1 commit into from
Jul 14, 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
86 changes: 85 additions & 1 deletion Classes/PHPExcel/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,33 @@ class PHPExcel_Chart
*/
private $_displayBlanksAs = '0';

/**
* Chart Asix Y as
*
* @var PHPExcel_Chart_Axis
*/
private $_yAxis = null;

/**
* Chart Asix X as
*
* @var PHPExcel_Chart_Axis
*/
private $_xAxis = null;

/**
* Chart Major Gridlines as
*
* @var PHPExcel_Chart_Gridlines
*/
private $_majorGridlines = null;

/**
* Chart Minor Gridlines as
*
* @var PHPExcel_Chart_Gridlines
*/
private $_minorGridlines = null;

/**
* Top-Left Cell Position
Expand Down Expand Up @@ -150,7 +177,7 @@ class PHPExcel_Chart
/**
* Create a new PHPExcel_Chart
*/
public function __construct($name, PHPExcel_Chart_Title $title = null, PHPExcel_Chart_Legend $legend = null, PHPExcel_Chart_PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '0', PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null)
public function __construct($name, PHPExcel_Chart_Title $title = null, PHPExcel_Chart_Legend $legend = null, PHPExcel_Chart_PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '0', PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, PHPExcel_Chart_Axis $xAxis = null, PHPExcel_Chart_Axis $yAxis = null, PHPExcel_Chart_Gridlines $majorGridlines = null, PHPExcel_Chart_Gridlines $minorGridlines = null)
{
$this->_name = $name;
$this->_title = $title;
Expand All @@ -160,6 +187,10 @@ public function __construct($name, PHPExcel_Chart_Title $title = null, PHPExcel_
$this->_plotArea = $plotArea;
$this->_plotVisibleOnly = $plotVisibleOnly;
$this->_displayBlanksAs = $displayBlanksAs;
$this->_xAxis = $xAxis;
$this->_yAxis = $yAxis;
$this->_majorGridlines = $majorGridlines;
$this->_minorGridlines = $minorGridlines;
}

/**
Expand Down Expand Up @@ -327,6 +358,59 @@ public function setDisplayBlanksAs($displayBlanksAs = '0') {
}


/**
* Get yAxis
*
* @return PHPExcel_Chart_Axis
*/
public function getChartAxisY() {
if($this->_yAxis !== NULL){
return $this->_yAxis;
}

return new PHPExcel_Chart_Axis();
}

/**
* Get xAxis
*
* @return PHPExcel_Chart_Axis
*/
public function getChartAxisX() {
if($this->_xAxis !== NULL){
return $this->_xAxis;
}

return new PHPExcel_Chart_Axis();
}

/**
* Get Major Gridlines
*
* @return PHPExcel_Chart_Gridlines
*/
public function getMajorGridlines() {
if($this->_majorGridlines !== NULL){
return $this->_majorGridlines;
}

return new PHPExcel_Chart_Gridlines();
}

/**
* Get Minor Gridlines
*
* @return PHPExcel_Chart_Gridlines
*/
public function getMinorGridlines() {
if($this->_minorGridlines !== NULL){
return $this->_minorGridlines;
}

return new PHPExcel_Chart_Gridlines();
}


/**
* Set the Top Left position for the chart
*
Expand Down
Loading