From e18ba38f16c020fd69bb6b01b5ec9e4aaf3f5b4f Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Fri, 15 May 2015 09:11:18 +0100 Subject: [PATCH] More psr-2 for charts --- Classes/PHPExcel/Chart/Axis.php | 182 ++++++----- Classes/PHPExcel/Chart/DataSeries.php | 90 +++--- Classes/PHPExcel/Chart/DataSeriesValues.php | 86 +++--- Classes/PHPExcel/Chart/GridLines.php | 137 ++++----- Classes/PHPExcel/Chart/Layout.php | 98 +++--- Classes/PHPExcel/Chart/Legend.php | 82 ++--- Classes/PHPExcel/Chart/PlotArea.php | 22 +- Classes/PHPExcel/Chart/Properties.php | 23 +- Classes/PHPExcel/Chart/Renderer/jpgraph.php | 325 ++++++++++---------- Classes/PHPExcel/Chart/Title.php | 36 +-- 10 files changed, 545 insertions(+), 536 deletions(-) diff --git a/Classes/PHPExcel/Chart/Axis.php b/Classes/PHPExcel/Chart/Axis.php index b032bf4..9aeafc6 100644 --- a/Classes/PHPExcel/Chart/Axis.php +++ b/Classes/PHPExcel/Chart/Axis.php @@ -14,7 +14,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @var array of mixed */ - private $_axis_number = array( + private $axisNumber = array( 'format' => self::FORMAT_CODE_GENERAL, 'source_linked' => 1 ); @@ -24,7 +24,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @var array of mixed */ - private $_axis_options = array( + private $axisOptions = array( 'minimum' => null, 'maximum' => null, 'major_unit' => null, @@ -42,7 +42,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @var array of mixed */ - private $_fill_properties = array( + private $fillProperties = array( 'type' => self::EXCEL_COLOR_TYPE_ARGB, 'value' => null, 'alpha' => 0 @@ -53,7 +53,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @var array of mixed */ - private $_line_properties = array( + private $lineProperties = array( 'type' => self::EXCEL_COLOR_TYPE_ARGB, 'value' => null, 'alpha' => 0 @@ -64,7 +64,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @var array of mixed */ - private $_line_style_properties = array( + private $lineStyleProperties = array( 'width' => '9525', 'compound' => self::LINE_STYLE_COMPOUND_SIMPLE, 'dash' => self::LINE_STYLE_DASH_SOLID, @@ -87,7 +87,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @var array of mixed */ - private $_shadow_properties = array( + private $shadowProperties = array( 'presets' => self::SHADOW_PRESETS_NOSHADOW, 'effect' => null, 'color' => array( @@ -112,7 +112,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @var array of mixed */ - private $_glow_properties = array( + private $glowProperties = array( 'size' => null, 'color' => array( 'type' => self::EXCEL_COLOR_TYPE_STANDARD, @@ -126,7 +126,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @var array of mixed */ - private $_soft_edges = array( + private $softEdges = array( 'size' => null ); @@ -137,8 +137,8 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function setAxisNumberProperties($format_code) { - $this->_axis_number['format'] = (string) $format_code; - $this->_axis_number['source_linked'] = 0; + $this->axisNumber['format'] = (string) $format_code; + $this->axisNumber['source_linked'] = 0; } /** @@ -148,7 +148,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function getAxisNumberFormat() { - return $this->_axis_number['format']; + return $this->axisNumber['format']; } /** @@ -158,7 +158,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function getAxisNumberSourceLinked() { - return (string) $this->_axis_number['source_linked']; + return (string) $this->axisNumber['source_linked']; } /** @@ -178,17 +178,17 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = null, $horizontal_crosses = null, $axis_orientation = null, $major_tmt = null, $minor_tmt = null, $minimum = null, $maximum = null, $major_unit = null, $minor_unit = null) { - $this->_axis_options['axis_labels'] = (string) $axis_labels; - ($horizontal_crosses_value !== null) ? $this->_axis_options['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null; - ($horizontal_crosses !== null) ? $this->_axis_options['horizontal_crosses'] = (string) $horizontal_crosses : null; - ($axis_orientation !== null) ? $this->_axis_options['orientation'] = (string) $axis_orientation : null; - ($major_tmt !== null) ? $this->_axis_options['major_tick_mark'] = (string) $major_tmt : null; - ($minor_tmt !== null) ? $this->_axis_options['minor_tick_mark'] = (string) $minor_tmt : null; - ($minor_tmt !== null) ? $this->_axis_options['minor_tick_mark'] = (string) $minor_tmt : null; - ($minimum !== null) ? $this->_axis_options['minimum'] = (string) $minimum : null; - ($maximum !== null) ? $this->_axis_options['maximum'] = (string) $maximum : null; - ($major_unit !== null) ? $this->_axis_options['major_unit'] = (string) $major_unit : null; - ($minor_unit !== null) ? $this->_axis_options['minor_unit'] = (string) $minor_unit : null; + $this->axisOptions['axis_labels'] = (string) $axis_labels; + ($horizontal_crosses_value !== null) ? $this->axisOptions['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null; + ($horizontal_crosses !== null) ? $this->axisOptions['horizontal_crosses'] = (string) $horizontal_crosses : null; + ($axis_orientation !== null) ? $this->axisOptions['orientation'] = (string) $axis_orientation : null; + ($major_tmt !== null) ? $this->axisOptions['major_tick_mark'] = (string) $major_tmt : null; + ($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null; + ($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null; + ($minimum !== null) ? $this->axisOptions['minimum'] = (string) $minimum : null; + ($maximum !== null) ? $this->axisOptions['maximum'] = (string) $maximum : null; + ($major_unit !== null) ? $this->axisOptions['major_unit'] = (string) $major_unit : null; + ($minor_unit !== null) ? $this->axisOptions['minor_unit'] = (string) $minor_unit : null; } /** @@ -200,7 +200,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function getAxisOptionsProperty($property) { - return $this->_axis_options[$property]; + return $this->axisOptions[$property]; } /** @@ -224,7 +224,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function setFillParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB) { - $this->_fill_properties = $this->setColorProperties($color, $alpha, $type); + $this->fillProperties = $this->setColorProperties($color, $alpha, $type); } /** @@ -237,7 +237,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function setLineParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB) { - $this->_line_properties = $this->setColorProperties($color, $alpha, $type); + $this->lineProperties = $this->setColorProperties($color, $alpha, $type); } /** @@ -249,7 +249,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function getFillProperty($property) { - return $this->_fill_properties[$property]; + return $this->fillProperties[$property]; } /** @@ -261,7 +261,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function getLineProperty($property) { - return $this->_line_properties[$property]; + return $this->lineProperties[$property]; } /** @@ -278,16 +278,17 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * @param string $end_arrow_size * */ - public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null) { - (!is_null($line_width)) ? $this->_line_style_properties['width'] = $this->getExcelPointsWidth((float) $line_width) : null; - (!is_null($compound_type)) ? $this->_line_style_properties['compound'] = (string) $compound_type : null; - (!is_null($dash_type)) ? $this->_line_style_properties['dash'] = (string) $dash_type : null; - (!is_null($cap_type)) ? $this->_line_style_properties['cap'] = (string) $cap_type : null; - (!is_null($join_type)) ? $this->_line_style_properties['join'] = (string) $join_type : null; - (!is_null($head_arrow_type)) ? $this->_line_style_properties['arrow']['head']['type'] = (string) $head_arrow_type : null; - (!is_null($head_arrow_size)) ? $this->_line_style_properties['arrow']['head']['size'] = (string) $head_arrow_size : null; - (!is_null($end_arrow_type)) ? $this->_line_style_properties['arrow']['end']['type'] = (string) $end_arrow_type : null; - (!is_null($end_arrow_size)) ? $this->_line_style_properties['arrow']['end']['size'] = (string) $end_arrow_size : null; + public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null) + { + (!is_null($line_width)) ? $this->lineStyleProperties['width'] = $this->getExcelPointsWidth((float) $line_width) : null; + (!is_null($compound_type)) ? $this->lineStyleProperties['compound'] = (string) $compound_type : null; + (!is_null($dash_type)) ? $this->lineStyleProperties['dash'] = (string) $dash_type : null; + (!is_null($cap_type)) ? $this->lineStyleProperties['cap'] = (string) $cap_type : null; + (!is_null($join_type)) ? $this->lineStyleProperties['join'] = (string) $join_type : null; + (!is_null($head_arrow_type)) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $head_arrow_type : null; + (!is_null($head_arrow_size)) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $head_arrow_size : null; + (!is_null($end_arrow_type)) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $end_arrow_type : null; + (!is_null($end_arrow_size)) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $end_arrow_size : null; } /** @@ -299,7 +300,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function getLineStyleProperty($elements) { - return $this->getArrayElementsValue($this->_line_style_properties, $elements); + return $this->getArrayElementsValue($this->lineStyleProperties, $elements); } /** @@ -311,7 +312,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function getLineStyleArrowWidth($arrow) { - return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'w'); + return $this->getLineStyleArrowSize($this->lineStyleProperties['arrow'][$arrow]['size'], 'w'); } /** @@ -323,7 +324,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties */ public function getLineStyleArrowLength($arrow) { - return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'len'); + return $this->getLineStyleArrowSize($this->lineStyleProperties['arrow'][$arrow]['size'], 'len'); } /** @@ -338,15 +339,17 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * @param float $sh_distance * */ - public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null) { - $this->_setShadowPresetsProperties((int) $sh_presets) - ->_setShadowColor( - is_null($sh_color_value) ? $this->_shadow_properties['color']['value'] : $sh_color_value - , is_null($sh_color_alpha) ? (int) $this->_shadow_properties['color']['alpha'] : $sh_color_alpha - , is_null($sh_color_type) ? $this->_shadow_properties['color']['type'] : $sh_color_type) - ->_setShadowBlur($sh_blur) - ->_setShadowAngle($sh_angle) - ->_setShadowDistance($sh_distance); + public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null) + { + $this->setShadowPresetsProperties((int) $sh_presets) + ->setShadowColor( + is_null($sh_color_value) ? $this->shadowProperties['color']['value'] : $sh_color_value, + is_null($sh_color_alpha) ? (int) $this->shadowProperties['color']['alpha'] : $sh_color_alpha, + is_null($sh_color_type) ? $this->shadowProperties['color']['type'] : $sh_color_type + ) + ->setShadowBlur($sh_blur) + ->setShadowAngle($sh_angle) + ->setShadowDistance($sh_distance); } /** @@ -356,9 +359,10 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @return PHPExcel_Chart_Axis */ - private function _setShadowPresetsProperties($shadow_presets) { - $this->_shadow_properties['presets'] = $shadow_presets; - $this->_setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); + private function setShadowPresetsProperties($shadow_presets) + { + $this->shadowProperties['presets'] = $shadow_presets; + $this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); return $this; } @@ -371,19 +375,20 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @return PHPExcel_Chart_Axis */ - private function _setShadowProperiesMapValues(array $properties_map, &$reference = null) { + private function setShadowProperiesMapValues(array $properties_map, &$reference = null) + { $base_reference = $reference; foreach ($properties_map as $property_key => $property_val) { if (is_array($property_val)) { if ($reference === null) { - $reference = & $this->_shadow_properties[$property_key]; + $reference = & $this->shadowProperties[$property_key]; } else { $reference = & $reference[$property_key]; } - $this->_setShadowProperiesMapValues($property_val, $reference); + $this->setShadowProperiesMapValues($property_val, $reference); } else { if ($base_reference === null) { - $this->_shadow_properties[$property_key] = $property_val; + $this->shadowProperties[$property_key] = $property_val; } else { $reference[$property_key] = $property_val; } @@ -402,8 +407,9 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @return PHPExcel_Chart_Axis */ - private function _setShadowColor($color, $alpha, $type) { - $this->_shadow_properties['color'] = $this->setColorProperties($color, $alpha, $type); + private function setShadowColor($color, $alpha, $type) + { + $this->shadowProperties['color'] = $this->setColorProperties($color, $alpha, $type); return $this; } @@ -415,9 +421,10 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @return PHPExcel_Chart_Axis */ - private function _setShadowBlur($blur) { + private function setShadowBlur($blur) + { if ($blur !== null) { - $this->_shadow_properties['blur'] = (string) $this->getExcelPointsWidth($blur); + $this->shadowProperties['blur'] = (string) $this->getExcelPointsWidth($blur); } return $this; @@ -430,9 +437,10 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @return PHPExcel_Chart_Axis */ - private function _setShadowAngle($angle) { + private function setShadowAngle($angle) + { if ($angle !== null) { - $this->_shadow_properties['direction'] = (string) $this->getExcelPointsAngle($angle); + $this->shadowProperties['direction'] = (string) $this->getExcelPointsAngle($angle); } return $this; @@ -445,9 +453,10 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @return PHPExcel_Chart_Axis */ - private function _setShadowDistance($distance) { + private function setShadowDistance($distance) + { if ($distance !== null) { - $this->_shadow_properties['distance'] = (string) $this->getExcelPointsWidth($distance); + $this->shadowProperties['distance'] = (string) $this->getExcelPointsWidth($distance); } return $this; @@ -461,8 +470,9 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * @param int $color_alpha * @param string $color_type */ - public function getShadowProperty($elements) { - return $this->getArrayElementsValue($this->_shadow_properties, $elements); + public function getShadowProperty($elements) + { + return $this->getArrayElementsValue($this->shadowProperties, $elements); } /** @@ -473,12 +483,13 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * @param int $color_alpha * @param string $color_type */ - public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null) { - $this->_setGlowSize($size) - ->_setGlowColor( - is_null($color_value) ? $this->_glow_properties['color']['value'] : $color_value - , is_null($color_alpha) ? (int) $this->_glow_properties['color']['alpha'] : $color_alpha - , is_null($color_type) ? $this->_glow_properties['color']['type'] : $color_type + public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null) + { + $this->setGlowSize($size) + ->setGlowColor( + is_null($color_value) ? $this->glowProperties['color']['value'] : $color_value, + is_null($color_alpha) ? (int) $this->glowProperties['color']['alpha'] : $color_alpha, + is_null($color_type) ? $this->glowProperties['color']['type'] : $color_type ); } @@ -489,8 +500,9 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @return string */ - public function getGlowProperty($property) { - return $this->getArrayElementsValue($this->_glow_properties, $property); + public function getGlowProperty($property) + { + return $this->getArrayElementsValue($this->glowProperties, $property); } /** @@ -500,9 +512,10 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @return PHPExcel_Chart_Axis */ - private function _setGlowSize($size) { + private function setGlowSize($size) + { if (!is_null($size)) { - $this->_glow_properties['size'] = $this->getExcelPointsWidth($size); + $this->glowProperties['size'] = $this->getExcelPointsWidth($size); } return $this; @@ -517,8 +530,9 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @return PHPExcel_Chart_Axis */ - private function _setGlowColor($color, $alpha, $type) { - $this->_glow_properties['color'] = $this->setColorProperties($color, $alpha, $type); + private function setGlowColor($color, $alpha, $type) + { + $this->glowProperties['color'] = $this->setColorProperties($color, $alpha, $type); return $this; } @@ -528,9 +542,10 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @param float $size */ - public function setSoftEdges($size) { + public function setSoftEdges($size) + { if (!is_null($size)) { - $_soft_edges['size'] = (string) $this->getExcelPointsWidth($size); + $softEdges['size'] = (string) $this->getExcelPointsWidth($size); } } @@ -539,7 +554,8 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties * * @return string */ - public function getSoftEdgesSize() { - return $this->_soft_edges['size']; + public function getSoftEdgesSize() + { + return $this->softEdges['size']; } } diff --git a/Classes/PHPExcel/Chart/DataSeries.php b/Classes/PHPExcel/Chart/DataSeries.php index 617c8a9..9ecd543 100644 --- a/Classes/PHPExcel/Chart/DataSeries.php +++ b/Classes/PHPExcel/Chart/DataSeries.php @@ -75,90 +75,90 @@ class PHPExcel_Chart_DataSeries * * @var string */ - private $_plotType = null; + private $plotType; /** * Plot Grouping Type * * @var boolean */ - private $_plotGrouping = null; + private $plotGrouping; /** * Plot Direction * * @var boolean */ - private $_plotDirection = null; + private $plotDirection; /** * Plot Style * * @var string */ - private $_plotStyle = null; + private $plotStyle; /** * Order of plots in Series * * @var array of integer */ - private $_plotOrder = array(); + private $plotOrder = array(); /** * Plot Label * * @var array of PHPExcel_Chart_DataSeriesValues */ - private $_plotLabel = array(); + private $plotLabel = array(); /** * Plot Category * * @var array of PHPExcel_Chart_DataSeriesValues */ - private $_plotCategory = array(); + private $plotCategory = array(); /** * Smooth Line * * @var string */ - private $_smoothLine = null; + private $smoothLine; /** * Plot Values * * @var array of PHPExcel_Chart_DataSeriesValues */ - private $_plotValues = array(); + private $plotValues = array(); /** * Create a new PHPExcel_Chart_DataSeries */ public function __construct($plotType = null, $plotGrouping = null, $plotOrder = array(), $plotLabel = array(), $plotCategory = array(), $plotValues = array(), $plotDirection = null, $smoothLine = null, $plotStyle = null) { - $this->_plotType = $plotType; - $this->_plotGrouping = $plotGrouping; - $this->_plotOrder = $plotOrder; + $this->plotType = $plotType; + $this->plotGrouping = $plotGrouping; + $this->plotOrder = $plotOrder; $keys = array_keys($plotValues); - $this->_plotValues = $plotValues; + $this->plotValues = $plotValues; if ((count($plotLabel) == 0) || (is_null($plotLabel[$keys[0]]))) { $plotLabel[$keys[0]] = new PHPExcel_Chart_DataSeriesValues(); } - $this->_plotLabel = $plotLabel; + $this->plotLabel = $plotLabel; if ((count($plotCategory) == 0) || (is_null($plotCategory[$keys[0]]))) { $plotCategory[$keys[0]] = new PHPExcel_Chart_DataSeriesValues(); } - $this->_plotCategory = $plotCategory; - $this->_smoothLine = $smoothLine; - $this->_plotStyle = $plotStyle; + $this->plotCategory = $plotCategory; + $this->smoothLine = $smoothLine; + $this->plotStyle = $plotStyle; if (is_null($plotDirection)) { $plotDirection = self::DIRECTION_COL; } - $this->_plotDirection = $plotDirection; + $this->plotDirection = $plotDirection; } /** @@ -168,7 +168,7 @@ class PHPExcel_Chart_DataSeries */ public function getPlotType() { - return $this->_plotType; + return $this->plotType; } /** @@ -179,7 +179,7 @@ class PHPExcel_Chart_DataSeries */ public function setPlotType($plotType = '') { - $this->_plotType = $plotType; + $this->plotType = $plotType; return $this; } @@ -190,7 +190,7 @@ class PHPExcel_Chart_DataSeries */ public function getPlotGrouping() { - return $this->_plotGrouping; + return $this->plotGrouping; } /** @@ -201,7 +201,7 @@ class PHPExcel_Chart_DataSeries */ public function setPlotGrouping($groupingType = null) { - $this->_plotGrouping = $groupingType; + $this->plotGrouping = $groupingType; return $this; } @@ -212,7 +212,7 @@ class PHPExcel_Chart_DataSeries */ public function getPlotDirection() { - return $this->_plotDirection; + return $this->plotDirection; } /** @@ -223,7 +223,7 @@ class PHPExcel_Chart_DataSeries */ public function setPlotDirection($plotDirection = null) { - $this->_plotDirection = $plotDirection; + $this->plotDirection = $plotDirection; return $this; } @@ -234,7 +234,7 @@ class PHPExcel_Chart_DataSeries */ public function getPlotOrder() { - return $this->_plotOrder; + return $this->plotOrder; } /** @@ -244,7 +244,7 @@ class PHPExcel_Chart_DataSeries */ public function getPlotLabels() { - return $this->_plotLabel; + return $this->plotLabel; } /** @@ -254,11 +254,11 @@ class PHPExcel_Chart_DataSeries */ public function getPlotLabelByIndex($index) { - $keys = array_keys($this->_plotLabel); + $keys = array_keys($this->plotLabel); if (in_array($index, $keys)) { - return $this->_plotLabel[$index]; + return $this->plotLabel[$index]; } elseif (isset($keys[$index])) { - return $this->_plotLabel[$keys[$index]]; + return $this->plotLabel[$keys[$index]]; } return false; } @@ -270,7 +270,7 @@ class PHPExcel_Chart_DataSeries */ public function getPlotCategories() { - return $this->_plotCategory; + return $this->plotCategory; } /** @@ -280,11 +280,11 @@ class PHPExcel_Chart_DataSeries */ public function getPlotCategoryByIndex($index) { - $keys = array_keys($this->_plotCategory); + $keys = array_keys($this->plotCategory); if (in_array($index, $keys)) { - return $this->_plotCategory[$index]; + return $this->plotCategory[$index]; } elseif (isset($keys[$index])) { - return $this->_plotCategory[$keys[$index]]; + return $this->plotCategory[$keys[$index]]; } return false; } @@ -296,7 +296,7 @@ class PHPExcel_Chart_DataSeries */ public function getPlotStyle() { - return $this->_plotStyle; + return $this->plotStyle; } /** @@ -307,7 +307,7 @@ class PHPExcel_Chart_DataSeries */ public function setPlotStyle($plotStyle = null) { - $this->_plotStyle = $plotStyle; + $this->plotStyle = $plotStyle; return $this; } @@ -318,7 +318,7 @@ class PHPExcel_Chart_DataSeries */ public function getPlotValues() { - return $this->_plotValues; + return $this->plotValues; } /** @@ -328,11 +328,11 @@ class PHPExcel_Chart_DataSeries */ public function getPlotValuesByIndex($index) { - $keys = array_keys($this->_plotValues); + $keys = array_keys($this->plotValues); if (in_array($index, $keys)) { - return $this->_plotValues[$index]; + return $this->plotValues[$index]; } elseif (isset($keys[$index])) { - return $this->_plotValues[$keys[$index]]; + return $this->plotValues[$keys[$index]]; } return false; } @@ -344,7 +344,7 @@ class PHPExcel_Chart_DataSeries */ public function getPlotSeriesCount() { - return count($this->_plotValues); + return count($this->plotValues); } /** @@ -354,7 +354,7 @@ class PHPExcel_Chart_DataSeries */ public function getSmoothLine() { - return $this->_smoothLine; + return $this->smoothLine; } /** @@ -365,23 +365,23 @@ class PHPExcel_Chart_DataSeries */ public function setSmoothLine($smoothLine = true) { - $this->_smoothLine = $smoothLine; + $this->smoothLine = $smoothLine; return $this; } public function refresh(PHPExcel_Worksheet $worksheet) { - foreach ($this->_plotValues as $plotValues) { + foreach ($this->plotValues as $plotValues) { if ($plotValues !== null) { $plotValues->refresh($worksheet, true); } } - foreach ($this->_plotLabel as $plotValues) { + foreach ($this->plotLabel as $plotValues) { if ($plotValues !== null) { $plotValues->refresh($worksheet, true); } } - foreach ($this->_plotCategory as $plotValues) { + foreach ($this->plotCategory as $plotValues) { if ($plotValues !== null) { $plotValues->refresh($worksheet, false); } diff --git a/Classes/PHPExcel/Chart/DataSeriesValues.php b/Classes/PHPExcel/Chart/DataSeriesValues.php index df88d62..23d185d 100644 --- a/Classes/PHPExcel/Chart/DataSeriesValues.php +++ b/Classes/PHPExcel/Chart/DataSeriesValues.php @@ -31,7 +31,7 @@ class PHPExcel_Chart_DataSeriesValues const DATASERIES_TYPE_STRING = 'String'; const DATASERIES_TYPE_NUMBER = 'Number'; - private static $_dataTypeValues = array( + private static $dataTypeValues = array( self::DATASERIES_TYPE_STRING, self::DATASERIES_TYPE_NUMBER, ); @@ -41,42 +41,42 @@ class PHPExcel_Chart_DataSeriesValues * * @var string */ - private $_dataType = null; + private $dataType; /** * Series Data Source * * @var string */ - private $_dataSource = null; + private $dataSource; /** * Format Code * * @var string */ - private $_formatCode = null; + private $formatCode; /** * Series Point Marker * * @var string */ - private $_marker = null; + private $pointMarker; /** * Point Count (The number of datapoints in the dataseries) * * @var integer */ - private $_pointCount = 0; + private $pointCount = 0; /** * Data Values * * @var array of mixed */ - private $_dataValues = array(); + private $dataValues = array(); /** * Create a new PHPExcel_Chart_DataSeriesValues object @@ -84,11 +84,11 @@ class PHPExcel_Chart_DataSeriesValues public function __construct($dataType = self::DATASERIES_TYPE_NUMBER, $dataSource = null, $formatCode = null, $pointCount = 0, $dataValues = array(), $marker = null) { $this->setDataType($dataType); - $this->_dataSource = $dataSource; - $this->_formatCode = $formatCode; - $this->_pointCount = $pointCount; - $this->_dataValues = $dataValues; - $this->_marker = $marker; + $this->dataSource = $dataSource; + $this->formatCode = $formatCode; + $this->pointCount = $pointCount; + $this->dataValues = $dataValues; + $this->pointMarker = $marker; } /** @@ -98,7 +98,7 @@ class PHPExcel_Chart_DataSeriesValues */ public function getDataType() { - return $this->_dataType; + return $this->dataType; } /** @@ -114,10 +114,10 @@ class PHPExcel_Chart_DataSeriesValues */ public function setDataType($dataType = self::DATASERIES_TYPE_NUMBER) { - if (!in_array($dataType, self::$_dataTypeValues)) { + if (!in_array($dataType, self::$dataTypeValues)) { throw new PHPExcel_Chart_Exception('Invalid datatype for chart data series values'); } - $this->_dataType = $dataType; + $this->dataType = $dataType; return $this; } @@ -129,7 +129,7 @@ class PHPExcel_Chart_DataSeriesValues */ public function getDataSource() { - return $this->_dataSource; + return $this->dataSource; } /** @@ -140,7 +140,7 @@ class PHPExcel_Chart_DataSeriesValues */ public function setDataSource($dataSource = null, $refreshDataValues = true) { - $this->_dataSource = $dataSource; + $this->dataSource = $dataSource; if ($refreshDataValues) { // TO DO @@ -156,7 +156,7 @@ class PHPExcel_Chart_DataSeriesValues */ public function getPointMarker() { - return $this->_marker; + return $this->pointMarker; } /** @@ -167,7 +167,7 @@ class PHPExcel_Chart_DataSeriesValues */ public function setPointMarker($marker = null) { - $this->_marker = $marker; + $this->pointMarker = $marker; return $this; } @@ -179,7 +179,7 @@ class PHPExcel_Chart_DataSeriesValues */ public function getFormatCode() { - return $this->_formatCode; + return $this->formatCode; } /** @@ -190,7 +190,7 @@ class PHPExcel_Chart_DataSeriesValues */ public function setFormatCode($formatCode = null) { - $this->_formatCode = $formatCode; + $this->formatCode = $formatCode; return $this; } @@ -202,7 +202,7 @@ class PHPExcel_Chart_DataSeriesValues */ public function getPointCount() { - return $this->_pointCount; + return $this->pointCount; } /** @@ -212,8 +212,8 @@ class PHPExcel_Chart_DataSeriesValues */ public function isMultiLevelSeries() { - if (count($this->_dataValues) > 0) { - return is_array($this->_dataValues[0]); + if (count($this->dataValues) > 0) { + return is_array($this->dataValues[0]); } return null; } @@ -226,8 +226,8 @@ class PHPExcel_Chart_DataSeriesValues public function multiLevelCount() { $levelCount = 0; - foreach ($this->_dataValues as $dataValueSet) { - $levelCount = max($levelCount,count($dataValueSet)); + foreach ($this->dataValues as $dataValueSet) { + $levelCount = max($levelCount, count($dataValueSet)); } return $levelCount; } @@ -239,7 +239,7 @@ class PHPExcel_Chart_DataSeriesValues */ public function getDataValues() { - return $this->_dataValues; + return $this->dataValues; } /** @@ -249,13 +249,13 @@ class PHPExcel_Chart_DataSeriesValues */ public function getDataValue() { - $count = count($this->_dataValues); + $count = count($this->dataValues); if ($count == 0) { return null; } elseif ($count == 1) { - return $this->_dataValues[0]; + return $this->dataValues[0]; } - return $this->_dataValues; + return $this->dataValues; } /** @@ -263,14 +263,14 @@ class PHPExcel_Chart_DataSeriesValues * * @param array $dataValues * @param boolean $refreshDataSource - * TRUE - refresh the value of _dataSource based on the values of $dataValues - * FALSE - don't change the value of _dataSource + * TRUE - refresh the value of dataSource based on the values of $dataValues + * FALSE - don't change the value of dataSource * @return PHPExcel_Chart_DataSeriesValues */ public function setDataValues($dataValues = array(), $refreshDataSource = true) { - $this->_dataValues = PHPExcel_Calculation_Functions::flattenArray($dataValues); - $this->_pointCount = count($dataValues); + $this->dataValues = PHPExcel_Calculation_Functions::flattenArray($dataValues); + $this->pointCount = count($dataValues); if ($refreshDataSource) { // TO DO @@ -279,39 +279,39 @@ class PHPExcel_Chart_DataSeriesValues return $this; } - private function _stripNulls($var) + private function stripNulls($var) { return $var !== null; } public function refresh(PHPExcel_Worksheet $worksheet, $flatten = true) { - if ($this->_dataSource !== null) { + if ($this->dataSource !== null) { $calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent()); $newDataValues = PHPExcel_Calculation::_unwrapResult( $calcEngine->_calculateFormulaValue( - '='.$this->_dataSource, + '='.$this->dataSource, null, $worksheet->getCell('A1') ) ); if ($flatten) { - $this->_dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues); - foreach ($this->_dataValues as &$dataValue) { + $this->dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues); + foreach ($this->dataValues as &$dataValue) { if ((!empty($dataValue)) && ($dataValue[0] == '#')) { $dataValue = 0.0; } } unset($dataValue); } else { - $cellRange = explode('!', $this->_dataSource); + $cellRange = explode('!', $this->dataSource); if (count($cellRange) > 1) { list(, $cellRange) = $cellRange; } $dimensions = PHPExcel_Cell::rangeDimension(str_replace('$', '', $cellRange)); if (($dimensions[0] == 1) || ($dimensions[1] == 1)) { - $this->_dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues); + $this->dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues); } else { $newArray = array_values(array_shift($newDataValues)); foreach ($newArray as $i => $newDataSet) { @@ -324,10 +324,10 @@ class PHPExcel_Chart_DataSeriesValues array_unshift($newArray[$i++], $newDataVal); } } - $this->_dataValues = $newArray; + $this->dataValues = $newArray; } } - $this->_pointCount = count($this->_dataValues); + $this->pointCount = count($this->dataValues); } } } diff --git a/Classes/PHPExcel/Chart/GridLines.php b/Classes/PHPExcel/Chart/GridLines.php index 69d8ed5..898012e 100644 --- a/Classes/PHPExcel/Chart/GridLines.php +++ b/Classes/PHPExcel/Chart/GridLines.php @@ -20,9 +20,9 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties * */ - private $_object_state = false; + private $objectState = false; - private $_line_properties = array( + private $lineProperties = array( 'color' => array( 'type' => self::EXCEL_COLOR_TYPE_STANDARD, 'value' => null, @@ -47,7 +47,7 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties ) ); - private $_shadow_properties = array( + private $shadowProperties = array( 'presets' => self::SHADOW_PRESETS_NOSHADOW, 'effect' => null, 'color' => array( @@ -67,7 +67,7 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties 'rotWithShape' => null ); - private $_glow_properties = array( + private $glowProperties = array( 'size' => null, 'color' => array( 'type' => self::EXCEL_COLOR_TYPE_STANDARD, @@ -76,7 +76,7 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties ) ); - private $_soft_edges = array( + private $softEdges = array( 'size' => null ); @@ -88,7 +88,7 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties public function getObjectState() { - return $this->_object_state; + return $this->objectState; } /** @@ -97,9 +97,9 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties * @return PHPExcel_Chart_GridLines */ - private function _activateObject() + private function activateObject() { - $this->_object_state = true; + $this->objectState = true; return $this; } @@ -114,12 +114,12 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties public function setLineColorProperties($value, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_STANDARD) { - $this - ->_activateObject() - ->_line_properties['color'] = $this->setColorProperties( + $this->activateObject() + ->lineProperties['color'] = $this->setColorProperties( $value, $alpha, - $type); + $type + ); } /** @@ -138,33 +138,33 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null) { - $this->_activateObject(); + $this->activateObject(); (!is_null($line_width)) - ? $this->_line_properties['style']['width'] = $this->getExcelPointsWidth((float) $line_width) + ? $this->lineProperties['style']['width'] = $this->getExcelPointsWidth((float) $line_width) : null; (!is_null($compound_type)) - ? $this->_line_properties['style']['compound'] = (string) $compound_type + ? $this->lineProperties['style']['compound'] = (string) $compound_type : null; (!is_null($dash_type)) - ? $this->_line_properties['style']['dash'] = (string) $dash_type + ? $this->lineProperties['style']['dash'] = (string) $dash_type : null; (!is_null($cap_type)) - ? $this->_line_properties['style']['cap'] = (string) $cap_type + ? $this->lineProperties['style']['cap'] = (string) $cap_type : null; (!is_null($join_type)) - ? $this->_line_properties['style']['join'] = (string) $join_type + ? $this->lineProperties['style']['join'] = (string) $join_type : null; (!is_null($head_arrow_type)) - ? $this->_line_properties['style']['arrow']['head']['type'] = (string) $head_arrow_type + ? $this->lineProperties['style']['arrow']['head']['type'] = (string) $head_arrow_type : null; (!is_null($head_arrow_size)) - ? $this->_line_properties['style']['arrow']['head']['size'] = (string) $head_arrow_size + ? $this->lineProperties['style']['arrow']['head']['size'] = (string) $head_arrow_size : null; (!is_null($end_arrow_type)) - ? $this->_line_properties['style']['arrow']['end']['type'] = (string) $end_arrow_type + ? $this->lineProperties['style']['arrow']['end']['type'] = (string) $end_arrow_type : null; (!is_null($end_arrow_size)) - ? $this->_line_properties['style']['arrow']['end']['size'] = (string) $end_arrow_size + ? $this->lineProperties['style']['arrow']['end']['size'] = (string) $end_arrow_size : null; } @@ -178,7 +178,7 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties public function getLineColorProperty($parameter) { - return $this->_line_properties['color'][$parameter]; + return $this->lineProperties['color'][$parameter]; } /** @@ -191,7 +191,7 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties public function getLineStyleProperty($elements) { - return $this->getArrayElementsValue($this->_line_properties['style'], $elements); + return $this->getArrayElementsValue($this->lineProperties['style'], $elements); } /** @@ -207,9 +207,9 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null) { $this - ->_activateObject() - ->_setGlowSize($size) - ->_setGlowColor($color_value, $color_alpha, $color_type); + ->activateObject() + ->setGlowSize($size) + ->setGlowColor($color_value, $color_alpha, $color_type); } /** @@ -222,7 +222,7 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties public function getGlowColor($property) { - return $this->_glow_properties['color'][$property]; + return $this->glowProperties['color'][$property]; } /** @@ -233,7 +233,7 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties public function getGlowSize() { - return $this->_glow_properties['size']; + return $this->glowProperties['size']; } /** @@ -244,9 +244,9 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties * @return PHPExcel_Chart_GridLines */ - private function _setGlowSize($size) + private function setGlowSize($size) { - $this->_glow_properties['size'] = $this->getExcelPointsWidth((float) $size); + $this->glowProperties['size'] = $this->getExcelPointsWidth((float) $size); return $this; } @@ -261,16 +261,16 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties * @return PHPExcel_Chart_GridLines */ - private function _setGlowColor($color, $alpha, $type) + private function setGlowColor($color, $alpha, $type) { if (!is_null($color)) { - $this->_glow_properties['color']['value'] = (string) $color; + $this->glowProperties['color']['value'] = (string) $color; } if (!is_null($alpha)) { - $this->_glow_properties['color']['alpha'] = $this->getTrueAlpha((int) $alpha); + $this->glowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha); } if (!is_null($type)) { - $this->_glow_properties['color']['type'] = (string) $type; + $this->glowProperties['color']['type'] = (string) $type; } return $this; @@ -287,7 +287,7 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties public function getLineStyleArrowParameters($arrow_selector, $property_selector) { - return $this->getLineStyleArrowSize($this->_line_properties['style']['arrow'][$arrow_selector]['size'], $property_selector); + return $this->getLineStyleArrowSize($this->lineProperties['style']['arrow'][$arrow_selector]['size'], $property_selector); } /** @@ -305,17 +305,16 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null) { - $this - ->_activateObject() - ->_setShadowPresetsProperties((int) $sh_presets) - ->_setShadowColor( - is_null($sh_color_value) ? $this->_shadow_properties['color']['value'] : $sh_color_value - , is_null($sh_color_alpha) ? (int) $this->_shadow_properties['color']['alpha'] - : $this->getTrueAlpha($sh_color_alpha) - , is_null($sh_color_type) ? $this->_shadow_properties['color']['type'] : $sh_color_type) - ->_setShadowBlur($sh_blur) - ->_setShadowAngle($sh_angle) - ->_setShadowDistance($sh_distance); + $this->activateObject() + ->setShadowPresetsProperties((int) $sh_presets) + ->setShadowColor( + is_null($sh_color_value) ? $this->shadowProperties['color']['value'] : $sh_color_value, + is_null($sh_color_alpha) ? (int) $this->shadowProperties['color']['alpha'] : $this->getTrueAlpha($sh_color_alpha), + is_null($sh_color_type) ? $this->shadowProperties['color']['type'] : $sh_color_type + ) + ->setShadowBlur($sh_blur) + ->setShadowAngle($sh_angle) + ->setShadowDistance($sh_distance); } /** @@ -326,10 +325,10 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties * @return PHPExcel_Chart_GridLines */ - private function _setShadowPresetsProperties($shadow_presets) + private function setShadowPresetsProperties($shadow_presets) { - $this->_shadow_properties['presets'] = $shadow_presets; - $this->_setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); + $this->shadowProperties['presets'] = $shadow_presets; + $this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); return $this; } @@ -343,20 +342,20 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties * @return PHPExcel_Chart_GridLines */ - private function _setShadowProperiesMapValues(array $properties_map, &$reference = null) + private function setShadowProperiesMapValues(array $properties_map, &$reference = null) { $base_reference = $reference; foreach ($properties_map as $property_key => $property_val) { if (is_array($property_val)) { if ($reference === null) { - $reference = & $this->_shadow_properties[$property_key]; + $reference = & $this->shadowProperties[$property_key]; } else { $reference = & $reference[$property_key]; } - $this->_setShadowProperiesMapValues($property_val, $reference); + $this->setShadowProperiesMapValues($property_val, $reference); } else { if ($base_reference === null) { - $this->_shadow_properties[$property_key] = $property_val; + $this->shadowProperties[$property_key] = $property_val; } else { $reference[$property_key] = $property_val; } @@ -374,16 +373,16 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties * @param string $type * @return PHPExcel_Chart_GridLines */ - private function _setShadowColor($color, $alpha, $type) + private function setShadowColor($color, $alpha, $type) { if (!is_null($color)) { - $this->_shadow_properties['color']['value'] = (string) $color; + $this->shadowProperties['color']['value'] = (string) $color; } if (!is_null($alpha)) { - $this->_shadow_properties['color']['alpha'] = $this->getTrueAlpha((int) $alpha); + $this->shadowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha); } if (!is_null($type)) { - $this->_shadow_properties['color']['type'] = (string) $type; + $this->shadowProperties['color']['type'] = (string) $type; } return $this; @@ -396,10 +395,10 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties * * @return PHPExcel_Chart_GridLines */ - private function _setShadowBlur($blur) + private function setShadowBlur($blur) { if ($blur !== null) { - $this->_shadow_properties['blur'] = (string) $this->getExcelPointsWidth($blur); + $this->shadowProperties['blur'] = (string) $this->getExcelPointsWidth($blur); } return $this; @@ -412,10 +411,10 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties * @return PHPExcel_Chart_GridLines */ - private function _setShadowAngle($angle) + private function setShadowAngle($angle) { if ($angle !== null) { - $this->_shadow_properties['direction'] = (string) $this->getExcelPointsAngle($angle); + $this->shadowProperties['direction'] = (string) $this->getExcelPointsAngle($angle); } return $this; @@ -427,10 +426,10 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties * @param float $distance * @return PHPExcel_Chart_GridLines */ - private function _setShadowDistance($distance) + private function setShadowDistance($distance) { if ($distance !== null) { - $this->_shadow_properties['distance'] = (string) $this->getExcelPointsWidth($distance); + $this->shadowProperties['distance'] = (string) $this->getExcelPointsWidth($distance); } return $this; @@ -445,7 +444,7 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties */ public function getShadowProperty($elements) { - return $this->getArrayElementsValue($this->_shadow_properties, $elements); + return $this->getArrayElementsValue($this->shadowProperties, $elements); } /** @@ -456,8 +455,8 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties public function setSoftEdgesSize($size) { if (!is_null($size)) { - $this->_activateObject(); - $_soft_edges['size'] = (string) $this->getExcelPointsWidth($size); + $this->activateObject(); + $softEdges['size'] = (string) $this->getExcelPointsWidth($size); } } @@ -468,6 +467,6 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties */ public function getSoftEdgesSize() { - return $this->_soft_edges['size']; + return $this->softEdges['size']; } -} \ No newline at end of file +} diff --git a/Classes/PHPExcel/Chart/Layout.php b/Classes/PHPExcel/Chart/Layout.php index 53a447c..7fef074 100644 --- a/Classes/PHPExcel/Chart/Layout.php +++ b/Classes/PHPExcel/Chart/Layout.php @@ -40,49 +40,49 @@ class PHPExcel_Chart_Layout * * @var string */ - private $_layoutTarget = null; + private $layoutTarget; /** * X Mode * * @var string */ - private $_xMode = null; + private $xMode; /** * Y Mode * * @var string */ - private $_yMode = null; + private $yMode; /** * X-Position * * @var float */ - private $_xPos = null; + private $xPos; /** * Y-Position * * @var float */ - private $_yPos = null; + private $yPos; /** * width * * @var float */ - private $_width = null; + private $width; /** * height * * @var float */ - private $_height = null; + private $height; /** * show legend key @@ -90,7 +90,7 @@ class PHPExcel_Chart_Layout * * @var boolean */ - private $_showLegendKey = null; + private $showLegendKey; /** * show value @@ -98,7 +98,7 @@ class PHPExcel_Chart_Layout * * @var boolean */ - private $_showVal = null; + private $showVal; /** * show category name @@ -106,7 +106,7 @@ class PHPExcel_Chart_Layout * * @var boolean */ - private $_showCatName = null; + private $showCatName; /** * show data series name @@ -114,7 +114,7 @@ class PHPExcel_Chart_Layout * * @var boolean */ - private $_showSerName = null; + private $showSerName; /** * show percentage @@ -122,14 +122,14 @@ class PHPExcel_Chart_Layout * * @var boolean */ - private $_showPercent = null; + private $showPercent; /** * show bubble size * * @var boolean */ - private $_showBubbleSize = null; + private $showBubbleSize; /** * show leader lines @@ -137,7 +137,7 @@ class PHPExcel_Chart_Layout * * @var boolean */ - private $_showLeaderLines = null; + private $showLeaderLines; /** @@ -146,25 +146,25 @@ class PHPExcel_Chart_Layout public function __construct($layout = array()) { if (isset($layout['layoutTarget'])) { - $this->_layoutTarget = $layout['layoutTarget']; + $this->layoutTarget = $layout['layoutTarget']; } if (isset($layout['xMode'])) { - $this->_xMode = $layout['xMode']; + $this->xMode = $layout['xMode']; } if (isset($layout['yMode'])) { - $this->_yMode = $layout['yMode']; + $this->yMode = $layout['yMode']; } if (isset($layout['x'])) { - $this->_xPos = (float) $layout['x']; + $this->xPos = (float) $layout['x']; } if (isset($layout['y'])) { - $this->_yPos = (float) $layout['y']; + $this->yPos = (float) $layout['y']; } if (isset($layout['w'])) { - $this->_width = (float) $layout['w']; + $this->width = (float) $layout['w']; } if (isset($layout['h'])) { - $this->_height = (float) $layout['h']; + $this->height = (float) $layout['h']; } } @@ -175,7 +175,7 @@ class PHPExcel_Chart_Layout */ public function getLayoutTarget() { - return $this->_layoutTarget; + return $this->layoutTarget; } /** @@ -186,7 +186,7 @@ class PHPExcel_Chart_Layout */ public function setLayoutTarget($value) { - $this->_layoutTarget = $value; + $this->layoutTarget = $value; return $this; } @@ -197,7 +197,7 @@ class PHPExcel_Chart_Layout */ public function getXMode() { - return $this->_xMode; + return $this->xMode; } /** @@ -208,7 +208,7 @@ class PHPExcel_Chart_Layout */ public function setXMode($value) { - $this->_xMode = $value; + $this->xMode = $value; return $this; } @@ -219,7 +219,7 @@ class PHPExcel_Chart_Layout */ public function getYMode() { - return $this->_yMode; + return $this->yMode; } /** @@ -230,7 +230,7 @@ class PHPExcel_Chart_Layout */ public function setYMode($value) { - $this->_yMode = $value; + $this->yMode = $value; return $this; } @@ -241,7 +241,7 @@ class PHPExcel_Chart_Layout */ public function getXPosition() { - return $this->_xPos; + return $this->xPos; } /** @@ -252,7 +252,7 @@ class PHPExcel_Chart_Layout */ public function setXPosition($value) { - $this->_xPos = $value; + $this->xPos = $value; return $this; } @@ -263,7 +263,7 @@ class PHPExcel_Chart_Layout */ public function getYPosition() { - return $this->_yPos; + return $this->yPos; } /** @@ -274,7 +274,7 @@ class PHPExcel_Chart_Layout */ public function setYPosition($value) { - $this->_yPos = $value; + $this->yPos = $value; return $this; } @@ -285,7 +285,7 @@ class PHPExcel_Chart_Layout */ public function getWidth() { - return $this->_width; + return $this->width; } /** @@ -296,7 +296,7 @@ class PHPExcel_Chart_Layout */ public function setWidth($value) { - $this->_width = $value; + $this->width = $value; return $this; } @@ -307,7 +307,7 @@ class PHPExcel_Chart_Layout */ public function getHeight() { - return $this->_height; + return $this->height; } /** @@ -318,7 +318,7 @@ class PHPExcel_Chart_Layout */ public function setHeight($value) { - $this->_height = $value; + $this->height = $value; return $this; } @@ -330,7 +330,7 @@ class PHPExcel_Chart_Layout */ public function getShowLegendKey() { - return $this->_showLegendKey; + return $this->showLegendKey; } /** @@ -342,7 +342,7 @@ class PHPExcel_Chart_Layout */ public function setShowLegendKey($value) { - $this->_showLegendKey = $value; + $this->showLegendKey = $value; return $this; } @@ -353,7 +353,7 @@ class PHPExcel_Chart_Layout */ public function getShowVal() { - return $this->_showVal; + return $this->showVal; } /** @@ -365,7 +365,7 @@ class PHPExcel_Chart_Layout */ public function setShowVal($value) { - $this->_showVal = $value; + $this->showVal = $value; return $this; } @@ -376,7 +376,7 @@ class PHPExcel_Chart_Layout */ public function getShowCatName() { - return $this->_showCatName; + return $this->showCatName; } /** @@ -388,7 +388,7 @@ class PHPExcel_Chart_Layout */ public function setShowCatName($value) { - $this->_showCatName = $value; + $this->showCatName = $value; return $this; } @@ -399,7 +399,7 @@ class PHPExcel_Chart_Layout */ public function getShowSerName() { - return $this->_showSerName; + return $this->showSerName; } /** @@ -411,7 +411,7 @@ class PHPExcel_Chart_Layout */ public function setShowSerName($value) { - $this->_showSerName = $value; + $this->showSerName = $value; return $this; } @@ -422,7 +422,7 @@ class PHPExcel_Chart_Layout */ public function getShowPercent() { - return $this->_showPercent; + return $this->showPercent; } /** @@ -434,7 +434,7 @@ class PHPExcel_Chart_Layout */ public function setShowPercent($value) { - $this->_showPercent = $value; + $this->showPercent = $value; return $this; } @@ -445,7 +445,7 @@ class PHPExcel_Chart_Layout */ public function getShowBubbleSize() { - return $this->_showBubbleSize; + return $this->showBubbleSize; } /** @@ -457,7 +457,7 @@ class PHPExcel_Chart_Layout */ public function setShowBubbleSize($value) { - $this->_showBubbleSize = $value; + $this->showBubbleSize = $value; return $this; } @@ -468,7 +468,7 @@ class PHPExcel_Chart_Layout */ public function getShowLeaderLines() { - return $this->_showLeaderLines; + return $this->showLeaderLines; } /** @@ -480,7 +480,7 @@ class PHPExcel_Chart_Layout */ public function setShowLeaderLines($value) { - $this->_showLeaderLines = $value; + $this->showLeaderLines = $value; return $this; } } diff --git a/Classes/PHPExcel/Chart/Legend.php b/Classes/PHPExcel/Chart/Legend.php index c44003b..60f47c8 100644 --- a/Classes/PHPExcel/Chart/Legend.php +++ b/Classes/PHPExcel/Chart/Legend.php @@ -28,26 +28,26 @@ class PHPExcel_Chart_Legend { /** Legend positions */ - const xlLegendPositionBottom = -4107; // Below the chart. - const xlLegendPositionCorner = 2; // In the upper right-hand corner of the chart border. - const xlLegendPositionCustom = -4161; // A custom position. - const xlLegendPositionLeft = -4131; // Left of the chart. - const xlLegendPositionRight = -4152; // Right of the chart. - const xlLegendPositionTop = -4160; // Above the chart. + const xlLegendPositionBottom = -4107; // Below the chart. + const xlLegendPositionCorner = 2; // In the upper right-hand corner of the chart border. + const xlLegendPositionCustom = -4161; // A custom position. + const xlLegendPositionLeft = -4131; // Left of the chart. + const xlLegendPositionRight = -4152; // Right of the chart. + const xlLegendPositionTop = -4160; // Above the chart. const POSITION_RIGHT = 'r'; - const POSITION_LEFT = 'l'; - const POSITION_BOTTOM = 'b'; - const POSITION_TOP = 't'; - const POSITION_TOPRIGHT = 'tr'; + const POSITION_LEFT = 'l'; + const POSITION_BOTTOM = 'b'; + const POSITION_TOP = 't'; + const POSITION_TOPRIGHT = 'tr'; private static $_positionXLref = array( - self::xlLegendPositionBottom => self::POSITION_BOTTOM, - self::xlLegendPositionCorner => self::POSITION_TOPRIGHT, - self::xlLegendPositionCustom => '??', - self::xlLegendPositionLeft => self::POSITION_LEFT, - self::xlLegendPositionRight => self::POSITION_RIGHT, - self::xlLegendPositionTop => self::POSITION_TOP + self::xlLegendPositionBottom => self::POSITION_BOTTOM, + self::xlLegendPositionCorner => self::POSITION_TOPRIGHT, + self::xlLegendPositionCustom => '??', + self::xlLegendPositionLeft => self::POSITION_LEFT, + self::xlLegendPositionRight => self::POSITION_RIGHT, + self::xlLegendPositionTop => self::POSITION_TOP ); /** @@ -55,30 +55,30 @@ class PHPExcel_Chart_Legend * * @var string */ - private $_position = self::POSITION_RIGHT; + private $position = self::POSITION_RIGHT; /** * Allow overlay of other elements? * * @var boolean */ - private $_overlay = TRUE; + private $overlay = true; /** * Legend Layout * * @var PHPExcel_Chart_Layout */ - private $_layout = NULL; + private $layout = null; /** * Create a new PHPExcel_Chart_Legend */ - public function __construct($position = self::POSITION_RIGHT, PHPExcel_Chart_Layout $layout = NULL, $overlay = FALSE) + public function __construct($position = self::POSITION_RIGHT, PHPExcel_Chart_Layout $layout = null, $overlay = false) { $this->setPosition($position); - $this->_layout = $layout; + $this->layout = $layout; $this->setOverlay($overlay); } @@ -87,8 +87,9 @@ class PHPExcel_Chart_Legend * * @return string */ - public function getPosition() { - return $this->_position; + public function getPosition() + { + return $this->position; } /** @@ -96,12 +97,13 @@ class PHPExcel_Chart_Legend * * @param string $position */ - public function setPosition($position = self::POSITION_RIGHT) { - if (!in_array($position,self::$_positionXLref)) { + public function setPosition($position = self::POSITION_RIGHT) + { + if (!in_array($position, self::$_positionXLref)) { return false; } - $this->_position = $position; + $this->position = $position; return true; } @@ -110,8 +112,9 @@ class PHPExcel_Chart_Legend * * @return number */ - public function getPositionXL() { - return array_search($this->_position,self::$_positionXLref); + public function getPositionXL() + { + return array_search($this->position, self::$_positionXLref); } /** @@ -119,12 +122,13 @@ class PHPExcel_Chart_Legend * * @param number $positionXL */ - public function setPositionXL($positionXL = self::xlLegendPositionRight) { - if (!array_key_exists($positionXL,self::$_positionXLref)) { + public function setPositionXL($positionXL = self::xlLegendPositionRight) + { + if (!array_key_exists($positionXL, self::$_positionXLref)) { return false; } - $this->_position = self::$_positionXLref[$positionXL]; + $this->position = self::$_positionXLref[$positionXL]; return true; } @@ -133,8 +137,9 @@ class PHPExcel_Chart_Legend * * @return boolean */ - public function getOverlay() { - return $this->_overlay; + public function getOverlay() + { + return $this->overlay; } /** @@ -143,12 +148,13 @@ class PHPExcel_Chart_Legend * @param boolean $overlay * @return boolean */ - public function setOverlay($overlay = FALSE) { + public function setOverlay($overlay = false) + { if (!is_bool($overlay)) { return false; } - $this->_overlay = $overlay; + $this->overlay = $overlay; return true; } @@ -157,8 +163,8 @@ class PHPExcel_Chart_Legend * * @return PHPExcel_Chart_Layout */ - public function getLayout() { - return $this->_layout; + public function getLayout() + { + return $this->layout; } - } diff --git a/Classes/PHPExcel/Chart/PlotArea.php b/Classes/PHPExcel/Chart/PlotArea.php index c2ff157..551cc51 100644 --- a/Classes/PHPExcel/Chart/PlotArea.php +++ b/Classes/PHPExcel/Chart/PlotArea.php @@ -32,22 +32,22 @@ class PHPExcel_Chart_PlotArea * * @var PHPExcel_Chart_Layout */ - private $_layout = null; + private $layout = null; /** * Plot Series * * @var array of PHPExcel_Chart_DataSeries */ - private $_plotSeries = array(); + private $plotSeries = array(); /** * Create a new PHPExcel_Chart_PlotArea */ public function __construct(PHPExcel_Chart_Layout $layout = null, $plotSeries = array()) { - $this->_layout = $layout; - $this->_plotSeries = $plotSeries; + $this->layout = $layout; + $this->plotSeries = $plotSeries; } /** @@ -57,7 +57,7 @@ class PHPExcel_Chart_PlotArea */ public function getLayout() { - return $this->_layout; + return $this->layout; } /** @@ -67,7 +67,7 @@ class PHPExcel_Chart_PlotArea */ public function getPlotGroupCount() { - return count($this->_plotSeries); + return count($this->plotSeries); } /** @@ -78,7 +78,7 @@ class PHPExcel_Chart_PlotArea public function getPlotSeriesCount() { $seriesCount = 0; - foreach ($this->_plotSeries as $plot) { + foreach ($this->plotSeries as $plot) { $seriesCount += $plot->getPlotSeriesCount(); } return $seriesCount; @@ -91,7 +91,7 @@ class PHPExcel_Chart_PlotArea */ public function getPlotGroup() { - return $this->_plotSeries; + return $this->plotSeries; } /** @@ -101,7 +101,7 @@ class PHPExcel_Chart_PlotArea */ public function getPlotGroupByIndex($index) { - return $this->_plotSeries[$index]; + return $this->plotSeries[$index]; } /** @@ -112,14 +112,14 @@ class PHPExcel_Chart_PlotArea */ public function setPlotSeries($plotSeries = array()) { - $this->_plotSeries = $plotSeries; + $this->plotSeries = $plotSeries; return $this; } public function refresh(PHPExcel_Worksheet $worksheet) { - foreach ($this->_plotSeries as $plotSeries) { + foreach ($this->plotSeries as $plotSeries) { $plotSeries->refresh($worksheet); } } diff --git a/Classes/PHPExcel/Chart/Properties.php b/Classes/PHPExcel/Chart/Properties.php index 3181f65..9bb6e93 100644 --- a/Classes/PHPExcel/Chart/Properties.php +++ b/Classes/PHPExcel/Chart/Properties.php @@ -70,7 +70,7 @@ abstract class PHPExcel_Chart_Properties LINE_STYLE_JOIN_MITER = 'miter', LINE_STYLE_JOIN_BEVEL = 'bevel', - LINE_STYLE_ARROW_TYPE_NOARROW = NULL, + LINE_STYLE_ARROW_TYPE_NOARROW = null, LINE_STYLE_ARROW_TYPE_ARROW = 'triangle', LINE_STYLE_ARROW_TYPE_OPEN = 'arrow', LINE_STYLE_ARROW_TYPE_STEALTH = 'stealth', @@ -88,7 +88,7 @@ abstract class PHPExcel_Chart_Properties LINE_STYLE_ARROW_SIZE_9 = 9; const - SHADOW_PRESETS_NOSHADOW = NULL, + SHADOW_PRESETS_NOSHADOW = null, SHADOW_PRESETS_OUTER_BOTTTOM_RIGHT = 1, SHADOW_PRESETS_OUTER_BOTTOM = 2, SHADOW_PRESETS_OUTER_BOTTOM_LEFT = 3, @@ -113,19 +113,19 @@ abstract class PHPExcel_Chart_Properties SHADOW_PRESETS_PERSPECTIVE_LOWER_RIGHT = 22, SHADOW_PRESETS_PERSPECTIVE_LOWER_LEFT = 23; - protected function getExcelPointsWidth($width) + protected function getExcelPointsWidth($width) { - return $width * 12700; + return $width * 12700; } protected function getExcelPointsAngle($angle) { - return $angle * 60000; + return $angle * 60000; } protected function getTrueAlpha($alpha) { - return (string) 100 - $alpha . '000'; + return (string) 100 - $alpha . '000'; } protected function setColorProperties($color, $alpha, $type) @@ -137,7 +137,8 @@ abstract class PHPExcel_Chart_Properties ); } - protected function getLineStyleArrowSize($array_selector, $array_kay_selector) { + protected function getLineStyleArrowSize($array_selector, $array_kay_selector) + { $sizes = array( 1 => array('w' => 'sm', 'len' => 'sm'), 2 => array('w' => 'sm', 'len' => 'med'), @@ -153,7 +154,8 @@ abstract class PHPExcel_Chart_Properties return $sizes[$array_selector][$array_kay_selector]; } - protected function getShadowPresetsMap($shadow_presets_option) { + protected function getShadowPresetsMap($shadow_presets_option) + { $presets_options = array( //OUTER 1 => array( @@ -345,7 +347,8 @@ abstract class PHPExcel_Chart_Properties return $presets_options[$shadow_presets_option]; } - protected function getArrayElementsValue($properties, $elements) { + protected function getArrayElementsValue($properties, $elements) + { $reference = & $properties; if (!is_array($elements)) { return $reference[$elements]; @@ -357,4 +360,4 @@ abstract class PHPExcel_Chart_Properties } return $this; } -} \ No newline at end of file +} diff --git a/Classes/PHPExcel/Chart/Renderer/jpgraph.php b/Classes/PHPExcel/Chart/Renderer/jpgraph.php index 2b49e65..a62f0b7 100644 --- a/Classes/PHPExcel/Chart/Renderer/jpgraph.php +++ b/Classes/PHPExcel/Chart/Renderer/jpgraph.php @@ -1,7 +1,9 @@ MARK_DIAMOND, - 'square' => MARK_SQUARE, - 'triangle' => MARK_UTRIANGLE, - 'x' => MARK_X, - 'star' => MARK_STAR, - 'dot' => MARK_FILLEDCIRCLE, - 'dash' => MARK_DTRIANGLE, - 'circle' => MARK_CIRCLE, - 'plus' => MARK_CROSS - ); + private static $markSet = array( + 'diamond' => MARK_DIAMOND, + 'square' => MARK_SQUARE, + 'triangle' => MARK_UTRIANGLE, + 'x' => MARK_X, + 'star' => MARK_STAR, + 'dot' => MARK_FILLEDCIRCLE, + 'dash' => MARK_DTRIANGLE, + 'circle' => MARK_CIRCLE, + 'plus' => MARK_CROSS + ); - private $_chart = null; + private $chart; - private $_graph = null; + private $graph; - private static $_plotColour = 0; + private static $_plotColour = 0; - private static $_plotMark = 0; + private static $_plotMark = 0; - private function _formatPointMarker($seriesPlot, $markerID) { - $plotMarkKeys = array_keys(self::$_markSet); + private function formatPointMarker($seriesPlot, $markerID) { + $plotMarkKeys = array_keys(self::$markSet); if (is_null($markerID)) { // Use default plot marker (next marker in the series) - self::$_plotMark %= count(self::$_markSet); - $seriesPlot->mark->SetType(self::$_markSet[$plotMarkKeys[self::$_plotMark++]]); + self::$_plotMark %= count(self::$markSet); + $seriesPlot->mark->SetType(self::$markSet[$plotMarkKeys[self::$_plotMark++]]); } elseif ($markerID !== 'none') { // Use specified plot marker (if it exists) - if (isset(self::$_markSet[$markerID])) { - $seriesPlot->mark->SetType(self::$_markSet[$markerID]); + if (isset(self::$markSet[$markerID])) { + $seriesPlot->mark->SetType(self::$markSet[$markerID]); } else { // If the specified plot marker doesn't exist, use default plot marker (next marker in the series) - self::$_plotMark %= count(self::$_markSet); - $seriesPlot->mark->SetType(self::$_markSet[$plotMarkKeys[self::$_plotMark++]]); + self::$_plotMark %= count(self::$markSet); + $seriesPlot->mark->SetType(self::$markSet[$plotMarkKeys[self::$_plotMark++]]); } } else { // Hide plot marker $seriesPlot->mark->Hide(); } - $seriesPlot->mark->SetColor(self::$_colourSet[self::$_plotColour]); - $seriesPlot->mark->SetFillColor(self::$_colourSet[self::$_plotColour]); - $seriesPlot->SetColor(self::$_colourSet[self::$_plotColour++]); + $seriesPlot->mark->SetColor(self::$colourSet[self::$_plotColour]); + $seriesPlot->mark->SetFillColor(self::$colourSet[self::$_plotColour]); + $seriesPlot->SetColor(self::$colourSet[self::$_plotColour++]); return $seriesPlot; - } // function _formatPointMarker() + } - private function _formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation = '') { - $datasetLabelFormatCode = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getFormatCode(); + private function formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation = '') { + $datasetLabelFormatCode = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getFormatCode(); if (!is_null($datasetLabelFormatCode)) { // Retrieve any label formatting code $datasetLabelFormatCode = stripslashes($datasetLabelFormatCode); @@ -124,16 +116,16 @@ class PHPExcel_Chart_Renderer_jpgraph } return $datasetLabels; - } // function _formatDataSetLabels() + } private function _percentageSumCalculation($groupID, $seriesCount) { // Adjust our values to a percentage value across all series in the group for($i = 0; $i < $seriesCount; ++$i) { if ($i == 0) { - $sumValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + $sumValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); } else { - $nextValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + $nextValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); foreach ($nextValues as $k => $value) { if (isset($sumValues[$k])) { $sumValues[$k] += $value; @@ -173,75 +165,75 @@ class PHPExcel_Chart_Renderer_jpgraph private function _renderTitle() { - $title = $this->_getCaption($this->_chart->getTitle()); + $title = $this->_getCaption($this->chart->getTitle()); if (!is_null($title)) { - $this->_graph->title->Set($title); + $this->graph->title->Set($title); } } // function _renderTitle() private function _renderLegend() { - $legend = $this->_chart->getLegend(); + $legend = $this->chart->getLegend(); if (!is_null($legend)) { $legendPosition = $legend->getPosition(); $legendOverlay = $legend->getOverlay(); switch ($legendPosition) { case 'r' : - $this->_graph->legend->SetPos(0.01,0.5,'right','center'); // right - $this->_graph->legend->SetColumns(1); + $this->graph->legend->SetPos(0.01,0.5,'right','center'); // right + $this->graph->legend->SetColumns(1); break; case 'l' : - $this->_graph->legend->SetPos(0.01,0.5,'left','center'); // left - $this->_graph->legend->SetColumns(1); + $this->graph->legend->SetPos(0.01,0.5,'left','center'); // left + $this->graph->legend->SetColumns(1); break; case 't' : - $this->_graph->legend->SetPos(0.5,0.01,'center','top'); // top + $this->graph->legend->SetPos(0.5,0.01,'center','top'); // top break; case 'b' : - $this->_graph->legend->SetPos(0.5,0.99,'center','bottom'); // bottom + $this->graph->legend->SetPos(0.5,0.99,'center','bottom'); // bottom break; default : - $this->_graph->legend->SetPos(0.01,0.01,'right','top'); // top-right - $this->_graph->legend->SetColumns(1); + $this->graph->legend->SetPos(0.01,0.01,'right','top'); // top-right + $this->graph->legend->SetColumns(1); break; } } else { - $this->_graph->legend->Hide(); + $this->graph->legend->Hide(); } } // function _renderLegend() private function _renderCartesianPlotArea($type='textlin') { - $this->_graph = new Graph(self::$_width,self::$_height); - $this->_graph->SetScale($type); + $this->graph = new Graph(self::$width,self::$height); + $this->graph->SetScale($type); $this->_renderTitle(); // Rotate for bar rather than column chart - $rotation = $this->_chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotDirection(); + $rotation = $this->chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotDirection(); $reverse = ($rotation == 'bar') ? true : false; - $xAxisLabel = $this->_chart->getXAxisLabel(); + $xAxisLabel = $this->chart->getXAxisLabel(); if (!is_null($xAxisLabel)) { $title = $this->_getCaption($xAxisLabel); if (!is_null($title)) { - $this->_graph->xaxis->SetTitle($title,'center'); - $this->_graph->xaxis->title->SetMargin(35); + $this->graph->xaxis->SetTitle($title,'center'); + $this->graph->xaxis->title->SetMargin(35); if ($reverse) { - $this->_graph->xaxis->title->SetAngle(90); - $this->_graph->xaxis->title->SetMargin(90); + $this->graph->xaxis->title->SetAngle(90); + $this->graph->xaxis->title->SetMargin(90); } } } - $yAxisLabel = $this->_chart->getYAxisLabel(); + $yAxisLabel = $this->chart->getYAxisLabel(); if (!is_null($yAxisLabel)) { $title = $this->_getCaption($yAxisLabel); if (!is_null($title)) { - $this->_graph->yaxis->SetTitle($title,'center'); + $this->graph->yaxis->SetTitle($title,'center'); if ($reverse) { - $this->_graph->yaxis->title->SetAngle(0); - $this->_graph->yaxis->title->SetMargin(-55); + $this->graph->yaxis->title->SetAngle(0); + $this->graph->yaxis->title->SetMargin(-55); } } } @@ -249,31 +241,31 @@ class PHPExcel_Chart_Renderer_jpgraph private function _renderPiePlotArea($doughnut = False) { - $this->_graph = new PieGraph(self::$_width,self::$_height); + $this->graph = new PieGraph(self::$width,self::$height); $this->_renderTitle(); } // function _renderPiePlotArea() private function _renderRadarPlotArea() { - $this->_graph = new RadarGraph(self::$_width,self::$_height); - $this->_graph->SetScale('lin'); + $this->graph = new RadarGraph(self::$width,self::$height); + $this->graph->SetScale('lin'); $this->_renderTitle(); } // function _renderRadarPlotArea() private function _renderPlotLine($groupID, $filled = false, $combination = false, $dimensions = '2d') { - $grouping = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); + $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); - $labelCount = count($this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); + $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); if ($labelCount > 0) { - $datasetLabels = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); - $datasetLabels = $this->_formatDataSetLabels($groupID, $datasetLabels, $labelCount); - $this->_graph->xaxis->SetTickLabels($datasetLabels); + $datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); + $datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount); + $this->graph->xaxis->SetTickLabels($datasetLabels); } - $seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); $seriesPlots = array(); if ($grouping == 'percentStacked') { $sumValues = $this->_percentageSumCalculation($groupID, $seriesCount); @@ -281,8 +273,8 @@ class PHPExcel_Chart_Renderer_jpgraph // Loop through each data series in turn for($i = 0; $i < $seriesCount; ++$i) { - $dataValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); - $marker = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker(); + $dataValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + $marker = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker(); if ($grouping == 'percentStacked') { $dataValues = $this->_percentageAdjustValues($dataValues, $sumValues); @@ -306,12 +298,12 @@ class PHPExcel_Chart_Renderer_jpgraph if ($filled) { $seriesPlot->SetFilled(true); $seriesPlot->SetColor('black'); - $seriesPlot->SetFillColor(self::$_colourSet[self::$_plotColour++]); + $seriesPlot->SetFillColor(self::$colourSet[self::$_plotColour++]); } else { // Set the appropriate plot marker - $this->_formatPointMarker($seriesPlot, $marker); + $this->formatPointMarker($seriesPlot, $marker); } - $dataLabel = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue(); + $dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue(); $seriesPlot->SetLegend($dataLabel); $seriesPlots[] = $seriesPlot; @@ -322,34 +314,34 @@ class PHPExcel_Chart_Renderer_jpgraph } else { $groupPlot = new AccLinePlot($seriesPlots); } - $this->_graph->Add($groupPlot); + $this->graph->Add($groupPlot); } // function _renderPlotLine() private function _renderPlotBar($groupID, $dimensions = '2d') { - $rotation = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotDirection(); + $rotation = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotDirection(); // Rotate for bar rather than column chart if (($groupID == 0) && ($rotation == 'bar')) { - $this->_graph->Set90AndMargin(); + $this->graph->Set90AndMargin(); } - $grouping = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); + $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); - $labelCount = count($this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); + $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); if ($labelCount > 0) { - $datasetLabels = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); - $datasetLabels = $this->_formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation); + $datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); + $datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation); // Rotate for bar rather than column chart if ($rotation == 'bar') { $datasetLabels = array_reverse($datasetLabels); - $this->_graph->yaxis->SetPos('max'); - $this->_graph->yaxis->SetLabelAlign('center','top'); - $this->_graph->yaxis->SetLabelSide(SIDE_RIGHT); + $this->graph->yaxis->SetPos('max'); + $this->graph->yaxis->SetLabelAlign('center','top'); + $this->graph->yaxis->SetLabelSide(SIDE_RIGHT); } - $this->_graph->xaxis->SetTickLabels($datasetLabels); + $this->graph->xaxis->SetTickLabels($datasetLabels); } - $seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); $seriesPlots = array(); if ($grouping == 'percentStacked') { $sumValues = $this->_percentageSumCalculation($groupID, $seriesCount); @@ -357,7 +349,7 @@ class PHPExcel_Chart_Renderer_jpgraph // Loop through each data series in turn for($j = 0; $j < $seriesCount; ++$j) { - $dataValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues(); + $dataValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues(); if ($grouping == 'percentStacked') { $dataValues = $this->_percentageAdjustValues($dataValues, $sumValues); } @@ -378,14 +370,14 @@ class PHPExcel_Chart_Renderer_jpgraph } $seriesPlot = new BarPlot($dataValues); $seriesPlot->SetColor('black'); - $seriesPlot->SetFillColor(self::$_colourSet[self::$_plotColour++]); + $seriesPlot->SetFillColor(self::$colourSet[self::$_plotColour++]); if ($dimensions == '3d') { $seriesPlot->SetShadow(); } - if (!$this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)) { + if (!$this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)) { $dataLabel = ''; } else { - $dataLabel = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)->getDataValue(); + $dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)->getDataValue(); } $seriesPlot->SetLegend($dataLabel); @@ -407,21 +399,21 @@ class PHPExcel_Chart_Renderer_jpgraph } } - $this->_graph->Add($groupPlot); + $this->graph->Add($groupPlot); } // function _renderPlotBar() private function _renderPlotScatter($groupID, $bubble) { - $grouping = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); - $scatterStyle = $bubbleSize = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); + $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); + $scatterStyle = $bubbleSize = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); - $seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); $seriesPlots = array(); // Loop through each data series in turn for($i = 0; $i < $seriesCount; ++$i) { - $dataValuesY = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues(); - $dataValuesX = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + $dataValuesY = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues(); + $dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); foreach ($dataValuesY as $k => $dataValueY) { $dataValuesY[$k] = $k; @@ -430,43 +422,43 @@ class PHPExcel_Chart_Renderer_jpgraph $seriesPlot = new ScatterPlot($dataValuesX, $dataValuesY); if ($scatterStyle == 'lineMarker') { $seriesPlot->SetLinkPoints(); - $seriesPlot->link->SetColor(self::$_colourSet[self::$_plotColour]); + $seriesPlot->link->SetColor(self::$colourSet[self::$_plotColour]); } elseif ($scatterStyle == 'smoothMarker') { $spline = new Spline($dataValuesY, $dataValuesX); - list($splineDataY, $splineDataX) = $spline->Get(count($dataValuesX) * self::$_width / 20); + list($splineDataY, $splineDataX) = $spline->Get(count($dataValuesX) * self::$width / 20); $lplot = new LinePlot($splineDataX, $splineDataY); - $lplot->SetColor(self::$_colourSet[self::$_plotColour]); + $lplot->SetColor(self::$colourSet[self::$_plotColour]); - $this->_graph->Add($lplot); + $this->graph->Add($lplot); } if ($bubble) { - $this->_formatPointMarker($seriesPlot,'dot'); + $this->formatPointMarker($seriesPlot,'dot'); $seriesPlot->mark->SetColor('black'); $seriesPlot->mark->SetSize($bubbleSize); } else { - $marker = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker(); - $this->_formatPointMarker($seriesPlot, $marker); + $marker = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker(); + $this->formatPointMarker($seriesPlot, $marker); } - $dataLabel = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue(); + $dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue(); $seriesPlot->SetLegend($dataLabel); - $this->_graph->Add($seriesPlot); + $this->graph->Add($seriesPlot); } } // function _renderPlotScatter() private function _renderPlotRadar($groupID) { - $radarStyle = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); + $radarStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); - $seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); $seriesPlots = array(); // Loop through each data series in turn for($i = 0; $i < $seriesCount; ++$i) { - $dataValuesY = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues(); - $dataValuesX = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); - $marker = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker(); + $dataValuesY = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues(); + $dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + $marker = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker(); $dataValues = array(); foreach ($dataValuesY as $k => $dataValueY) { @@ -477,51 +469,51 @@ class PHPExcel_Chart_Renderer_jpgraph $tmp = array_shift($dataValuesX); $dataValuesX[] = $tmp; - $this->_graph->SetTitles(array_reverse($dataValues)); + $this->graph->SetTitles(array_reverse($dataValues)); $seriesPlot = new RadarPlot(array_reverse($dataValuesX)); - $dataLabel = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue(); - $seriesPlot->SetColor(self::$_colourSet[self::$_plotColour++]); + $dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue(); + $seriesPlot->SetColor(self::$colourSet[self::$_plotColour++]); if ($radarStyle == 'filled') { - $seriesPlot->SetFillColor(self::$_colourSet[self::$_plotColour]); + $seriesPlot->SetFillColor(self::$colourSet[self::$_plotColour]); } - $this->_formatPointMarker($seriesPlot, $marker); + $this->formatPointMarker($seriesPlot, $marker); $seriesPlot->SetLegend($dataLabel); - $this->_graph->Add($seriesPlot); + $this->graph->Add($seriesPlot); } } // function _renderPlotRadar() private function _renderPlotContour($groupID) { - $contourStyle = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); + $contourStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); - $seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); $seriesPlots = array(); $dataValues = array(); // Loop through each data series in turn for($i = 0; $i < $seriesCount; ++$i) { - $dataValuesY = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues(); - $dataValuesX = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); + $dataValuesY = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues(); + $dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues(); $dataValues[$i] = $dataValuesX; } $seriesPlot = new ContourPlot($dataValues); - $this->_graph->Add($seriesPlot); + $this->graph->Add($seriesPlot); } // function _renderPlotContour() private function _renderPlotStock($groupID) { - $seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); - $plotOrder = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotOrder(); + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $plotOrder = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotOrder(); $dataValues = array(); // Loop through each data series in turn and build the plot arrays foreach ($plotOrder as $i => $v) { - $dataValuesX = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($v)->getDataValues(); + $dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($v)->getDataValues(); foreach ($dataValuesX as $j => $dataValueX) { $dataValues[$plotOrder[$i]][$j] = $dataValueX; } @@ -539,17 +531,17 @@ class PHPExcel_Chart_Renderer_jpgraph } // Set the x-axis labels - $labelCount = count($this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); + $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); if ($labelCount > 0) { - $datasetLabels = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); - $datasetLabels = $this->_formatDataSetLabels($groupID, $datasetLabels, $labelCount); - $this->_graph->xaxis->SetTickLabels($datasetLabels); + $datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); + $datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount); + $this->graph->xaxis->SetTickLabels($datasetLabels); } $seriesPlot = new StockPlot($dataValuesPlot); $seriesPlot->SetWidth(20); - $this->_graph->Add($seriesPlot); + $this->graph->Add($seriesPlot); } // function _renderPlotStock() @@ -620,23 +612,23 @@ class PHPExcel_Chart_Renderer_jpgraph $iLimit = ($multiplePlots) ? $groupCount : 1; for($groupID = 0; $groupID < $iLimit; ++$groupID) { - $grouping = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); - $exploded = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); + $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping(); + $exploded = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle(); if ($groupID == 0) { - $labelCount = count($this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); + $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount()); if ($labelCount > 0) { - $datasetLabels = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); - $datasetLabels = $this->_formatDataSetLabels($groupID, $datasetLabels, $labelCount); + $datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues(); + $datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount); } } - $seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); + $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount(); $seriesPlots = array(); // For pie charts, we only display the first series: doughnut charts generally display all series $jLimit = ($multiplePlots) ? $seriesCount : 1; // Loop through each data series in turn for($j = 0; $j < $jLimit; ++$j) { - $dataValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues(); + $dataValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues(); // Fill in any missing values in the $dataValues array $testCurrentIndex = 0; @@ -666,7 +658,7 @@ class PHPExcel_Chart_Renderer_jpgraph $seriesPlot->SetMidColor('white'); } - $seriesPlot->SetColor(self::$_colourSet[self::$_plotColour++]); + $seriesPlot->SetColor(self::$colourSet[self::$_plotColour++]); if (count($datasetLabels) > 0) $seriesPlot->SetLabels(array_fill(0,count($datasetLabels),'')); if ($dimensions != '3d') { @@ -679,7 +671,7 @@ class PHPExcel_Chart_Renderer_jpgraph $seriesPlot->SetLegends($datasetLabels); } - $this->_graph->Add($seriesPlot); + $this->graph->Add($seriesPlot); } } } // function _renderPieChart() @@ -729,7 +721,7 @@ class PHPExcel_Chart_Renderer_jpgraph for($i = 0; $i < $groupCount; ++$i) { $dimensions = null; - $chartType = $this->_chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType(); + $chartType = $this->chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType(); switch ($chartType) { case 'area3DChart' : $dimensions = '3d'; @@ -753,14 +745,14 @@ class PHPExcel_Chart_Renderer_jpgraph $this->_renderPlotScatter($i,true); break; default : - $this->_graph = null; + $this->graph = null; return false; } } $this->_renderLegend(); - $this->_graph->Stroke($outputDestination); + $this->graph->Stroke($outputDestination); return true; } // function _renderCombinationChart() @@ -768,15 +760,15 @@ class PHPExcel_Chart_Renderer_jpgraph public function render($outputDestination) { self::$_plotColour = 0; - $groupCount = $this->_chart->getPlotArea()->getPlotGroupCount(); + $groupCount = $this->chart->getPlotArea()->getPlotGroupCount(); $dimensions = null; if ($groupCount == 1) { - $chartType = $this->_chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType(); + $chartType = $this->chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType(); } else { $chartTypes = array(); for($i = 0; $i < $groupCount; ++$i) { - $chartTypes[] = $this->_chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType(); + $chartTypes[] = $this->chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType(); } $chartTypes = array_unique($chartTypes); if (count($chartTypes) == 1) { @@ -838,9 +830,9 @@ class PHPExcel_Chart_Renderer_jpgraph } $this->_renderLegend(); - $this->_graph->Stroke($outputDestination); + $this->graph->Stroke($outputDestination); return true; - } // function render() + } /** @@ -848,8 +840,7 @@ class PHPExcel_Chart_Renderer_jpgraph */ public function __construct(PHPExcel_Chart $chart) { - $this->_graph = null; - $this->_chart = $chart; - } // function __construct() - -} // PHPExcel_Chart_Renderer_jpgraph + $this->graph = null; + $this->chart = $chart; + } +} diff --git a/Classes/PHPExcel/Chart/Title.php b/Classes/PHPExcel/Chart/Title.php index c68a0b9..d8dc14f 100644 --- a/Classes/PHPExcel/Chart/Title.php +++ b/Classes/PHPExcel/Chart/Title.php @@ -1,6 +1,7 @@ _caption = $caption; - $this->_layout = $layout; + $this->caption = $caption; + $this->layout = $layout; } /** @@ -64,8 +56,9 @@ class PHPExcel_Chart_Title * * @return string */ - public function getCaption() { - return $this->_caption; + public function getCaption() + { + return $this->caption; } /** @@ -74,8 +67,9 @@ class PHPExcel_Chart_Title * @param string $caption * @return PHPExcel_Chart_Title */ - public function setCaption($caption = null) { - $this->_caption = $caption; + public function setCaption($caption = null) + { + $this->caption = $caption; return $this; } @@ -85,8 +79,8 @@ class PHPExcel_Chart_Title * * @return PHPExcel_Chart_Layout */ - public function getLayout() { - return $this->_layout; + public function getLayout() + { + return $this->layout; } - }