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

Commit

Permalink
--Added 3 new classes: PHPExcel_Chart_Axis, PHPExcel_Chart_GridLines,…
Browse files Browse the repository at this point in the history
… PHPExcel_Chart_Properties.php

--Modified Chart.php and Writer/Excel2007/Chart.php for using new classes
--Now it is possible to set some (most of existing) options of Axis, Major Grid-lines and Minor Grid-lines
--No need to use that feature
  • Loading branch information
Wiktor committed Jul 14, 2014
1 parent 78a0657 commit 568038c
Show file tree
Hide file tree
Showing 5 changed files with 3,056 additions and 1,168 deletions.
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

0 comments on commit 568038c

Please sign in to comment.