Improve fluent interface in charting methods

This commit is contained in:
Mark Baker 2013-12-30 23:44:42 +00:00
parent 19fc61114d
commit dc97d2f46b
5 changed files with 46 additions and 1 deletions

View File

@ -170,9 +170,11 @@ class PHPExcel_Chart_DataSeries
* Set Plot Type * Set Plot Type
* *
* @param string $plotType * @param string $plotType
* @return PHPExcel_Chart_DataSeries
*/ */
public function setPlotType($plotType = '') { public function setPlotType($plotType = '') {
$this->_plotType = $plotType; $this->_plotType = $plotType;
return $this;
} }
/** /**
@ -188,9 +190,11 @@ class PHPExcel_Chart_DataSeries
* Set Plot Grouping Type * Set Plot Grouping Type
* *
* @param string $groupingType * @param string $groupingType
* @return PHPExcel_Chart_DataSeries
*/ */
public function setPlotGrouping($groupingType = null) { public function setPlotGrouping($groupingType = null) {
$this->_plotGrouping = $groupingType; $this->_plotGrouping = $groupingType;
return $this;
} }
/** /**
@ -206,9 +210,11 @@ class PHPExcel_Chart_DataSeries
* Set Plot Direction * Set Plot Direction
* *
* @param string $plotDirection * @param string $plotDirection
* @return PHPExcel_Chart_DataSeries
*/ */
public function setPlotDirection($plotDirection = null) { public function setPlotDirection($plotDirection = null) {
$this->_plotDirection = $plotDirection; $this->_plotDirection = $plotDirection;
return $this;
} }
/** /**
@ -281,9 +287,11 @@ class PHPExcel_Chart_DataSeries
* Set Plot Style * Set Plot Style
* *
* @param string $plotStyle * @param string $plotStyle
* @return PHPExcel_Chart_DataSeries
*/ */
public function setPlotStyle($plotStyle = null) { public function setPlotStyle($plotStyle = null) {
$this->_plotStyle = $plotStyle; $this->_plotStyle = $plotStyle;
return $this;
} }
/** /**
@ -332,9 +340,11 @@ class PHPExcel_Chart_DataSeries
* Set Smooth Line * Set Smooth Line
* *
* @param boolean $smoothLine * @param boolean $smoothLine
* @return PHPExcel_Chart_DataSeries
*/ */
public function setSmoothLine($smoothLine = TRUE) { public function setSmoothLine($smoothLine = TRUE) {
$this->_smoothLine = $smoothLine; $this->_smoothLine = $smoothLine;
return $this;
} }
public function refresh(PHPExcel_Worksheet $worksheet) { public function refresh(PHPExcel_Worksheet $worksheet) {

View File

@ -167,9 +167,11 @@ class PHPExcel_Chart_Layout
* Set Layout Target * Set Layout Target
* *
* @param Layout Target $value * @param Layout Target $value
* @return PHPExcel_Chart_Layout
*/ */
public function setLayoutTarget($value) { public function setLayoutTarget($value) {
$this->_layoutTarget = $value; $this->_layoutTarget = $value;
return $this;
} }
/** /**
@ -185,9 +187,11 @@ class PHPExcel_Chart_Layout
* Set X-Mode * Set X-Mode
* *
* @param X-Mode $value * @param X-Mode $value
* @return PHPExcel_Chart_Layout
*/ */
public function setXMode($value) { public function setXMode($value) {
$this->_xMode = $value; $this->_xMode = $value;
return $this;
} }
/** /**
@ -203,9 +207,11 @@ class PHPExcel_Chart_Layout
* Set Y-Mode * Set Y-Mode
* *
* @param Y-Mode $value * @param Y-Mode $value
* @return PHPExcel_Chart_Layout
*/ */
public function setYMode($value) { public function setYMode($value) {
$this->_yMode = $value; $this->_yMode = $value;
return $this;
} }
/** /**
@ -221,9 +227,11 @@ class PHPExcel_Chart_Layout
* Set X-Position * Set X-Position
* *
* @param X-Position $value * @param X-Position $value
* @return PHPExcel_Chart_Layout
*/ */
public function setXPosition($value) { public function setXPosition($value) {
$this->_xPos = $value; $this->_xPos = $value;
return $this;
} }
/** /**
@ -239,9 +247,11 @@ class PHPExcel_Chart_Layout
* Set Y-Position * Set Y-Position
* *
* @param Y-Position $value * @param Y-Position $value
* @return PHPExcel_Chart_Layout
*/ */
public function setYPosition($value) { public function setYPosition($value) {
$this->_yPos = $value; $this->_yPos = $value;
return $this;
} }
/** /**
@ -257,9 +267,11 @@ class PHPExcel_Chart_Layout
* Set Width * Set Width
* *
* @param Width $value * @param Width $value
* @return PHPExcel_Chart_Layout
*/ */
public function setWidth($value) { public function setWidth($value) {
$this->_width = $value; $this->_width = $value;
return $this;
} }
/** /**
@ -275,9 +287,11 @@ class PHPExcel_Chart_Layout
* Set Height * Set Height
* *
* @param Height $value * @param Height $value
* @return PHPExcel_Chart_Layout
*/ */
public function setHeight($value) { public function setHeight($value) {
$this->_height = $value; $this->_height = $value;
return $this;
} }
@ -295,9 +309,11 @@ class PHPExcel_Chart_Layout
* Specifies that legend keys should be shown in data labels. * Specifies that legend keys should be shown in data labels.
* *
* @param boolean $value Show legend key * @param boolean $value Show legend key
* @return PHPExcel_Chart_Layout
*/ */
public function setShowLegendKey($value) { public function setShowLegendKey($value) {
$this->_showLegendKey = $value; $this->_showLegendKey = $value;
return $this;
} }
/** /**
@ -314,9 +330,11 @@ class PHPExcel_Chart_Layout
* Specifies that the value should be shown in data labels. * Specifies that the value should be shown in data labels.
* *
* @param boolean $value Show val * @param boolean $value Show val
* @return PHPExcel_Chart_Layout
*/ */
public function setShowVal($value) { public function setShowVal($value) {
$this->_showVal = $value; $this->_showVal = $value;
return $this;
} }
/** /**
@ -333,9 +351,11 @@ class PHPExcel_Chart_Layout
* Specifies that the category name should be shown in data labels. * Specifies that the category name should be shown in data labels.
* *
* @param boolean $value Show cat name * @param boolean $value Show cat name
* @return PHPExcel_Chart_Layout
*/ */
public function setShowCatName($value) { public function setShowCatName($value) {
$this->_showCatName = $value; $this->_showCatName = $value;
return $this;
} }
/** /**
@ -351,10 +371,12 @@ class PHPExcel_Chart_Layout
* Set show ser name * Set show ser name
* Specifies that the series name should be shown in data labels. * Specifies that the series name should be shown in data labels.
* *
* @param boolean $value Show ser name * @param boolean $value Show series name
* @return PHPExcel_Chart_Layout
*/ */
public function setShowSerName($value) { public function setShowSerName($value) {
$this->_showSerName = $value; $this->_showSerName = $value;
return $this;
} }
/** /**
@ -371,9 +393,11 @@ class PHPExcel_Chart_Layout
* Specifies that the percentage should be shown in data labels. * Specifies that the percentage should be shown in data labels.
* *
* @param boolean $value Show percentage * @param boolean $value Show percentage
* @return PHPExcel_Chart_Layout
*/ */
public function setShowPercent($value) { public function setShowPercent($value) {
$this->_showPercent = $value; $this->_showPercent = $value;
return $this;
} }
/** /**
@ -390,9 +414,11 @@ class PHPExcel_Chart_Layout
* Specifies that the bubble size should be shown in data labels. * Specifies that the bubble size should be shown in data labels.
* *
* @param boolean $value Show bubble size * @param boolean $value Show bubble size
* @return PHPExcel_Chart_Layout
*/ */
public function setShowBubbleSize($value) { public function setShowBubbleSize($value) {
$this->_showBubbleSize = $value; $this->_showBubbleSize = $value;
return $this;
} }
/** /**
@ -409,9 +435,11 @@ class PHPExcel_Chart_Layout
* Specifies that leader lines should be shown in data labels. * Specifies that leader lines should be shown in data labels.
* *
* @param boolean $value Show leader lines * @param boolean $value Show leader lines
* @return PHPExcel_Chart_Layout
*/ */
public function setShowLeaderLines($value) { public function setShowLeaderLines($value) {
$this->_showLeaderLines = $value; $this->_showLeaderLines = $value;
return $this;
} }
} }

View File

@ -111,9 +111,12 @@ class PHPExcel_Chart_PlotArea
* Set Plot Series * Set Plot Series
* *
* @param [PHPExcel_Chart_DataSeries] * @param [PHPExcel_Chart_DataSeries]
* @return PHPExcel_Chart_PlotArea
*/ */
public function setPlotSeries($plotSeries = array()) { public function setPlotSeries($plotSeries = array()) {
$this->_plotSeries = $plotSeries; $this->_plotSeries = $plotSeries;
return $this;
} }
public function refresh(PHPExcel_Worksheet $worksheet) { public function refresh(PHPExcel_Worksheet $worksheet) {

View File

@ -72,9 +72,12 @@ class PHPExcel_Chart_Title
* Set caption * Set caption
* *
* @param string $caption * @param string $caption
* @return PHPExcel_Chart_Title
*/ */
public function setCaption($caption = null) { public function setCaption($caption = null) {
$this->_caption = $caption; $this->_caption = $caption;
return $this;
} }
/** /**

View File

@ -92,6 +92,7 @@ $aTests = array(
, '34chartupdate.php' , '34chartupdate.php'
, '35chartrender.php' , '35chartrender.php'
, '36chartreadwriteHTML.php' , '36chartreadwriteHTML.php'
, '36chartreadwritePDF.php'
, '37page_layout_view.php' , '37page_layout_view.php'
, '38cloneWorksheet.php' , '38cloneWorksheet.php'
, '40duplicateStyle.php' , '40duplicateStyle.php'