From a2a0e9b419853d2b0d95c976c2ceb3faaf0cedf5 Mon Sep 17 00:00:00 2001 From: M_Viper Date: Sun, 10 Mar 2024 15:27:49 +0000 Subject: [PATCH] Dateien nach "includes/PHPExcel/Classes/PHPExcel/Chart" hochladen --- .../PHPExcel/Classes/PHPExcel/Chart/Axis.php | 584 ++++++++++++++++++ .../Classes/PHPExcel/Chart/DataSeries.php | 370 +++++++++++ .../PHPExcel/Chart/DataSeriesValues.php | 327 ++++++++++ .../Classes/PHPExcel/Chart/Exception.php | 52 ++ .../Classes/PHPExcel/Chart/GridLines.php | 458 ++++++++++++++ .../Classes/PHPExcel/Chart/Layout.php | 445 +++++++++++++ .../Classes/PHPExcel/Chart/Legend.php | 171 +++++ .../Classes/PHPExcel/Chart/PlotArea.php | 128 ++++ .../Classes/PHPExcel/Chart/Properties.php | 359 +++++++++++ .../PHPExcel/Classes/PHPExcel/Chart/Title.php | 92 +++ 10 files changed, 2986 insertions(+) create mode 100644 includes/PHPExcel/Classes/PHPExcel/Chart/Axis.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/Chart/DataSeries.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/Chart/DataSeriesValues.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/Chart/Exception.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/Chart/GridLines.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/Chart/Layout.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/Chart/Legend.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/Chart/PlotArea.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/Chart/Properties.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/Chart/Title.php diff --git a/includes/PHPExcel/Classes/PHPExcel/Chart/Axis.php b/includes/PHPExcel/Classes/PHPExcel/Chart/Axis.php new file mode 100644 index 0000000..efb39e9 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/Chart/Axis.php @@ -0,0 +1,584 @@ + self::FORMAT_CODE_GENERAL, + 'source_linked' => 1 + ); + + /** + * Axis Options + * + * @var array of mixed + */ + + private $_axis_options = array( + 'minimum' => NULL, + 'maximum' => NULL, + 'major_unit' => NULL, + 'minor_unit' => NULL, + 'orientation' => self::ORIENTATION_NORMAL, + 'minor_tick_mark' => self::TICK_MARK_NONE, + 'major_tick_mark' => self::TICK_MARK_NONE, + 'axis_labels' => self::AXIS_LABELS_NEXT_TO, + 'horizontal_crosses' => self::HORIZONTAL_CROSSES_AUTOZERO, + 'horizontal_crosses_value' => NULL + ); + + /** + * Fill Properties + * + * @var array of mixed + */ + + private $_fill_properties = array( + 'type' => self::EXCEL_COLOR_TYPE_ARGB, + 'value' => NULL, + 'alpha' => 0 + ); + + /** + * Line Properties + * + * @var array of mixed + */ + + private $_line_properties = array( + 'type' => self::EXCEL_COLOR_TYPE_ARGB, + 'value' => NULL, + 'alpha' => 0 + ); + + /** + * Line Style Properties + * + * @var array of mixed + */ + + private $_line_style_properties = array( + 'width' => '9525', + 'compound' => self::LINE_STYLE_COMPOUND_SIMPLE, + 'dash' => self::LINE_STYLE_DASH_SOLID, + 'cap' => self::LINE_STYLE_CAP_FLAT, + 'join' => self::LINE_STYLE_JOIN_BEVEL, + 'arrow' => array( + 'head' => array( + 'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW, + 'size' => self::LINE_STYLE_ARROW_SIZE_5 + ), + 'end' => array( + 'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW, + 'size' => self::LINE_STYLE_ARROW_SIZE_8 + ), + ) + ); + + /** + * Shadow Properties + * + * @var array of mixed + */ + + private $_shadow_properties = array( + 'presets' => self::SHADOW_PRESETS_NOSHADOW, + 'effect' => NULL, + 'color' => array( + 'type' => self::EXCEL_COLOR_TYPE_STANDARD, + 'value' => 'black', + 'alpha' => 40, + ), + 'size' => array( + 'sx' => NULL, + 'sy' => NULL, + 'kx' => NULL + ), + 'blur' => NULL, + 'direction' => NULL, + 'distance' => NULL, + 'algn' => NULL, + 'rotWithShape' => NULL + ); + + /** + * Glow Properties + * + * @var array of mixed + */ + + private $_glow_properties = array( + 'size' => NULL, + 'color' => array( + 'type' => self::EXCEL_COLOR_TYPE_STANDARD, + 'value' => 'black', + 'alpha' => 40 + ) + ); + + /** + * Soft Edge Properties + * + * @var array of mixed + */ + + private $_soft_edges = array( + 'size' => NULL + ); + + /** + * Get Series Data Type + * + * @return string + */ + + public function setAxisNumberProperties($format_code) { + $this->_axis_number['format'] = (string) $format_code; + $this->_axis_number['source_linked'] = 0; + } + + /** + * Get Axis Number Format Data Type + * + * @return string + */ + + public function getAxisNumberFormat() { + return $this->_axis_number['format']; + } + + /** + * Get Axis Number Source Linked + * + * @return string + */ + + public function getAxisNumberSourceLinked() { + return (string) $this->_axis_number['source_linked']; + } + + /** + * Set Axis Options Properties + * + * @param string $axis_labels + * @param string $horizontal_crosses_value + * @param string $horizontal_crosses + * @param string $axis_orientation + * @param string $major_tmt + * @param string $minor_tmt + * @param string $minimum + * @param string $maximum + * @param string $major_unit + * @param string $minor_unit + * + */ + + 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; + } + + /** + * Get Axis Options Property + * + * @param string $property + * + * @return string + */ + + public function getAxisOptionsProperty($property) { + return $this->_axis_options[$property]; + } + + /** + * Set Axis Orientation Property + * + * @param string $orientation + * + */ + + public function setAxisOrientation($orientation) { + $this->orientation = (string) $orientation; + } + + /** + * Set Fill Property + * + * @param string $color + * @param int $alpha + * @param string $type + * + */ + + public function setFillParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB) { + $this->_fill_properties = $this->setColorProperties($color, $alpha, $type); + } + + /** + * Set Line Property + * + * @param string $color + * @param int $alpha + * @param string $type + * + */ + + public function setLineParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB) { + $this->_line_properties = $this->setColorProperties($color, $alpha, $type); + } + + /** + * Get Fill Property + * + * @param string $property + * + * @return string + */ + + public function getFillProperty($property) { + return $this->_fill_properties[$property]; + } + + /** + * Get Line Property + * + * @param string $property + * + * @return string + */ + + public function getLineProperty($property) { + return $this->_line_properties[$property]; + } + + /** + * Set Line Style Properties + * + * @param float $line_width + * @param string $compound_type + * @param string $dash_type + * @param string $cap_type + * @param string $join_type + * @param string $head_arrow_type + * @param string $head_arrow_size + * @param string $end_arrow_type + * @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; + } + + /** + * Get Line Style Property + * + * @param array|string $elements + * + * @return string + */ + + public function getLineStyleProperty($elements) { + return $this->getArrayElementsValue($this->_line_style_properties, $elements); + } + + /** + * Get Line Style Arrow Excel Width + * + * @param string $arrow + * + * @return string + */ + + public function getLineStyleArrowWidth($arrow) { + return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'w'); + } + + /** + * Get Line Style Arrow Excel Length + * + * @param string $arrow + * + * @return string + */ + + public function getLineStyleArrowLength($arrow) { + return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'len'); + } + + /** + * Set Shadow Properties + * + * @param int $shadow_presets + * @param string $sh_color_value + * @param string $sh_color_type + * @param string $sh_color_alpha + * @param float $sh_blur + * @param int $sh_angle + * @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); + } + + /** + * Set Shadow Color + * + * @param int $shadow_presets + * + * @return PHPExcel_Chart_Axis + */ + + private function _setShadowPresetsProperties($shadow_presets) { + $this->_shadow_properties['presets'] = $shadow_presets; + $this->_setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); + + return $this; + } + + /** + * Set Shadow Properties from Maped Values + * + * @param array $properties_map + * @param * $reference + * + * @return PHPExcel_Chart_Axis + */ + + 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]; + } else { + $reference = & $reference[$property_key]; + } + $this->_setShadowProperiesMapValues($property_val, $reference); + } else { + if ($base_reference === NULL) { + $this->_shadow_properties[$property_key] = $property_val; + } else { + $reference[$property_key] = $property_val; + } + } + } + + return $this; + } + + /** + * Set Shadow Color + * + * @param string $color + * @param int $alpha + * @param string $type + * + * @return PHPExcel_Chart_Axis + */ + + private function _setShadowColor($color, $alpha, $type) { + $this->_shadow_properties['color'] = $this->setColorProperties($color, $alpha, $type); + + return $this; + } + + /** + * Set Shadow Blur + * + * @param float $blur + * + * @return PHPExcel_Chart_Axis + */ + + private function _setShadowBlur($blur) { + if ($blur !== NULL) { + $this->_shadow_properties['blur'] = (string) $this->getExcelPointsWidth($blur); + } + + return $this; + } + + /** + * Set Shadow Angle + * + * @param int $angle + * + * @return PHPExcel_Chart_Axis + */ + + private function _setShadowAngle($angle) { + if ($angle !== NULL) { + $this->_shadow_properties['direction'] = (string) $this->getExcelPointsAngle($angle); + } + + return $this; + } + + /** + * Set Shadow Distance + * + * @param float $distance + * + * @return PHPExcel_Chart_Axis + */ + + private function _setShadowDistance($distance) { + if ($distance !== NULL) { + $this->_shadow_properties['distance'] = (string) $this->getExcelPointsWidth($distance); + } + + return $this; + } + + /** + * Get Glow Property + * + * @param float $size + * @param string $color_value + * @param int $color_alpha + * @param string $color_type + */ + + public function getShadowProperty($elements) { + return $this->getArrayElementsValue($this->_shadow_properties, $elements); + } + + /** + * Set Glow Properties + * + * @param float $size + * @param string $color_value + * @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); + } + + /** + * Get Glow Property + * + * @param array|string $property + * + * @return string + */ + + public function getGlowProperty($property) { + return $this->getArrayElementsValue($this->_glow_properties, $property); + } + + /** + * Set Glow Color + * + * @param float $size + * + * @return PHPExcel_Chart_Axis + */ + + private function _setGlowSize($size) { + if (!is_null($size)) { + $this->_glow_properties['size'] = $this->getExcelPointsWidth($size); + } + + return $this; + } + + /** + * Set Glow Color + * + * @param string $color + * @param int $alpha + * @param string $type + * + * @return PHPExcel_Chart_Axis + */ + + private function _setGlowColor($color, $alpha, $type) { + $this->_glow_properties['color'] = $this->setColorProperties($color, $alpha, $type); + + return $this; + } + + /** + * Set Soft Edges Size + * + * @param float $size + */ + + public function setSoftEdges($size) { + if (!is_null($size)) { + $_soft_edges['size'] = (string) $this->getExcelPointsWidth($size); + } + } + + /** + * Get Soft Edges Size + * + * @return string + */ + + public function getSoftEdgesSize() { + return $this->_soft_edges['size']; + } +} \ No newline at end of file diff --git a/includes/PHPExcel/Classes/PHPExcel/Chart/DataSeries.php b/includes/PHPExcel/Classes/PHPExcel/Chart/DataSeries.php new file mode 100644 index 0000000..56faf6e --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/Chart/DataSeries.php @@ -0,0 +1,370 @@ +_plotType = $plotType; + $this->_plotGrouping = $plotGrouping; + $this->_plotOrder = $plotOrder; + $keys = array_keys($plotValues); + $this->_plotValues = $plotValues; + if ((count($plotLabel) == 0) || (is_null($plotLabel[$keys[0]]))) { + $plotLabel[$keys[0]] = new PHPExcel_Chart_DataSeriesValues(); + } + + $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; + + if (is_null($plotDirection)) { + $plotDirection = self::DIRECTION_COL; + } + $this->_plotDirection = $plotDirection; + } + + /** + * Get Plot Type + * + * @return string + */ + public function getPlotType() { + return $this->_plotType; + } + + /** + * Set Plot Type + * + * @param string $plotType + * @return PHPExcel_Chart_DataSeries + */ + public function setPlotType($plotType = '') { + $this->_plotType = $plotType; + return $this; + } + + /** + * Get Plot Grouping Type + * + * @return string + */ + public function getPlotGrouping() { + return $this->_plotGrouping; + } + + /** + * Set Plot Grouping Type + * + * @param string $groupingType + * @return PHPExcel_Chart_DataSeries + */ + public function setPlotGrouping($groupingType = null) { + $this->_plotGrouping = $groupingType; + return $this; + } + + /** + * Get Plot Direction + * + * @return string + */ + public function getPlotDirection() { + return $this->_plotDirection; + } + + /** + * Set Plot Direction + * + * @param string $plotDirection + * @return PHPExcel_Chart_DataSeries + */ + public function setPlotDirection($plotDirection = null) { + $this->_plotDirection = $plotDirection; + return $this; + } + + /** + * Get Plot Order + * + * @return string + */ + public function getPlotOrder() { + return $this->_plotOrder; + } + + /** + * Get Plot Labels + * + * @return array of PHPExcel_Chart_DataSeriesValues + */ + public function getPlotLabels() { + return $this->_plotLabel; + } + + /** + * Get Plot Label by Index + * + * @return PHPExcel_Chart_DataSeriesValues + */ + public function getPlotLabelByIndex($index) { + $keys = array_keys($this->_plotLabel); + if (in_array($index,$keys)) { + return $this->_plotLabel[$index]; + } elseif(isset($keys[$index])) { + return $this->_plotLabel[$keys[$index]]; + } + return false; + } + + /** + * Get Plot Categories + * + * @return array of PHPExcel_Chart_DataSeriesValues + */ + public function getPlotCategories() { + return $this->_plotCategory; + } + + /** + * Get Plot Category by Index + * + * @return PHPExcel_Chart_DataSeriesValues + */ + public function getPlotCategoryByIndex($index) { + $keys = array_keys($this->_plotCategory); + if (in_array($index,$keys)) { + return $this->_plotCategory[$index]; + } elseif(isset($keys[$index])) { + return $this->_plotCategory[$keys[$index]]; + } + return false; + } + + /** + * Get Plot Style + * + * @return string + */ + public function getPlotStyle() { + return $this->_plotStyle; + } + + /** + * Set Plot Style + * + * @param string $plotStyle + * @return PHPExcel_Chart_DataSeries + */ + public function setPlotStyle($plotStyle = null) { + $this->_plotStyle = $plotStyle; + return $this; + } + + /** + * Get Plot Values + * + * @return array of PHPExcel_Chart_DataSeriesValues + */ + public function getPlotValues() { + return $this->_plotValues; + } + + /** + * Get Plot Values by Index + * + * @return PHPExcel_Chart_DataSeriesValues + */ + public function getPlotValuesByIndex($index) { + $keys = array_keys($this->_plotValues); + if (in_array($index,$keys)) { + return $this->_plotValues[$index]; + } elseif(isset($keys[$index])) { + return $this->_plotValues[$keys[$index]]; + } + return false; + } + + /** + * Get Number of Plot Series + * + * @return integer + */ + public function getPlotSeriesCount() { + return count($this->_plotValues); + } + + /** + * Get Smooth Line + * + * @return boolean + */ + public function getSmoothLine() { + return $this->_smoothLine; + } + + /** + * Set Smooth Line + * + * @param boolean $smoothLine + * @return PHPExcel_Chart_DataSeries + */ + public function setSmoothLine($smoothLine = TRUE) { + $this->_smoothLine = $smoothLine; + return $this; + } + + public function refresh(PHPExcel_Worksheet $worksheet) { + foreach($this->_plotValues as $plotValues) { + if ($plotValues !== NULL) + $plotValues->refresh($worksheet, TRUE); + } + foreach($this->_plotLabel as $plotValues) { + if ($plotValues !== NULL) + $plotValues->refresh($worksheet, TRUE); + } + foreach($this->_plotCategory as $plotValues) { + if ($plotValues !== NULL) + $plotValues->refresh($worksheet, FALSE); + } + } + +} diff --git a/includes/PHPExcel/Classes/PHPExcel/Chart/DataSeriesValues.php b/includes/PHPExcel/Classes/PHPExcel/Chart/DataSeriesValues.php new file mode 100644 index 0000000..731d2c9 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/Chart/DataSeriesValues.php @@ -0,0 +1,327 @@ +setDataType($dataType); + $this->_dataSource = $dataSource; + $this->_formatCode = $formatCode; + $this->_pointCount = $pointCount; + $this->_dataValues = $dataValues; + $this->_marker = $marker; + } + + /** + * Get Series Data Type + * + * @return string + */ + public function getDataType() { + return $this->_dataType; + } + + /** + * Set Series Data Type + * + * @param string $dataType Datatype of this data series + * Typical values are: + * PHPExcel_Chart_DataSeriesValues::DATASERIES_TYPE_STRING + * Normally used for axis point values + * PHPExcel_Chart_DataSeriesValues::DATASERIES_TYPE_NUMBER + * Normally used for chart data values + * @return PHPExcel_Chart_DataSeriesValues + */ + public function setDataType($dataType = self::DATASERIES_TYPE_NUMBER) { + if (!in_array($dataType, self::$_dataTypeValues)) { + throw new PHPExcel_Chart_Exception('Invalid datatype for chart data series values'); + } + $this->_dataType = $dataType; + + return $this; + } + + /** + * Get Series Data Source (formula) + * + * @return string + */ + public function getDataSource() { + return $this->_dataSource; + } + + /** + * Set Series Data Source (formula) + * + * @param string $dataSource + * @return PHPExcel_Chart_DataSeriesValues + */ + public function setDataSource($dataSource = null, $refreshDataValues = true) { + $this->_dataSource = $dataSource; + + if ($refreshDataValues) { + // TO DO + } + + return $this; + } + + /** + * Get Point Marker + * + * @return string + */ + public function getPointMarker() { + return $this->_marker; + } + + /** + * Set Point Marker + * + * @param string $marker + * @return PHPExcel_Chart_DataSeriesValues + */ + public function setPointMarker($marker = null) { + $this->_marker = $marker; + + return $this; + } + + /** + * Get Series Format Code + * + * @return string + */ + public function getFormatCode() { + return $this->_formatCode; + } + + /** + * Set Series Format Code + * + * @param string $formatCode + * @return PHPExcel_Chart_DataSeriesValues + */ + public function setFormatCode($formatCode = null) { + $this->_formatCode = $formatCode; + + return $this; + } + + /** + * Get Series Point Count + * + * @return integer + */ + public function getPointCount() { + return $this->_pointCount; + } + + /** + * Identify if the Data Series is a multi-level or a simple series + * + * @return boolean + */ + public function isMultiLevelSeries() { + if (count($this->_dataValues) > 0) { + return is_array($this->_dataValues[0]); + } + return null; + } + + /** + * Return the level count of a multi-level Data Series + * + * @return boolean + */ + public function multiLevelCount() { + $levelCount = 0; + foreach($this->_dataValues as $dataValueSet) { + $levelCount = max($levelCount,count($dataValueSet)); + } + return $levelCount; + } + + /** + * Get Series Data Values + * + * @return array of mixed + */ + public function getDataValues() { + return $this->_dataValues; + } + + /** + * Get the first Series Data value + * + * @return mixed + */ + public function getDataValue() { + $count = count($this->_dataValues); + if ($count == 0) { + return null; + } elseif ($count == 1) { + return $this->_dataValues[0]; + } + return $this->_dataValues; + } + + /** + * Set Series Data Values + * + * @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 + * @return PHPExcel_Chart_DataSeriesValues + */ + public function setDataValues($dataValues = array(), $refreshDataSource = TRUE) { + $this->_dataValues = PHPExcel_Calculation_Functions::flattenArray($dataValues); + $this->_pointCount = count($dataValues); + + if ($refreshDataSource) { + // TO DO + } + + return $this; + } + + private function _stripNulls($var) { + return $var !== NULL; + } + + public function refresh(PHPExcel_Worksheet $worksheet, $flatten = TRUE) { + if ($this->_dataSource !== NULL) { + $calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent()); + $newDataValues = PHPExcel_Calculation::_unwrapResult( + $calcEngine->_calculateFormulaValue( + '='.$this->_dataSource, + NULL, + $worksheet->getCell('A1') + ) + ); + if ($flatten) { + $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); + 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); + } else { + $newArray = array_values(array_shift($newDataValues)); + foreach($newArray as $i => $newDataSet) { + $newArray[$i] = array($newDataSet); + } + + foreach($newDataValues as $newDataSet) { + $i = 0; + foreach($newDataSet as $newDataVal) { + array_unshift($newArray[$i++],$newDataVal); + } + } + $this->_dataValues = $newArray; + } + } + $this->_pointCount = count($this->_dataValues); + } + + } + +} diff --git a/includes/PHPExcel/Classes/PHPExcel/Chart/Exception.php b/includes/PHPExcel/Classes/PHPExcel/Chart/Exception.php new file mode 100644 index 0000000..58b5b58 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/Chart/Exception.php @@ -0,0 +1,52 @@ +line = $line; + $e->file = $file; + throw $e; + } +} diff --git a/includes/PHPExcel/Classes/PHPExcel/Chart/GridLines.php b/includes/PHPExcel/Classes/PHPExcel/Chart/GridLines.php new file mode 100644 index 0000000..269860c --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/Chart/GridLines.php @@ -0,0 +1,458 @@ + array( + 'type' => self::EXCEL_COLOR_TYPE_STANDARD, + 'value' => NULL, + 'alpha' => 0 + ), + 'style' => array( + 'width' => '9525', + 'compound' => self::LINE_STYLE_COMPOUND_SIMPLE, + 'dash' => self::LINE_STYLE_DASH_SOLID, + 'cap' => self::LINE_STYLE_CAP_FLAT, + 'join' => self::LINE_STYLE_JOIN_BEVEL, + 'arrow' => array( + 'head' => array( + 'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW, + 'size' => self::LINE_STYLE_ARROW_SIZE_5 + ), + 'end' => array( + 'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW, + 'size' => self::LINE_STYLE_ARROW_SIZE_8 + ), + ) + ) + ), + $_shadow_properties = array( + 'presets' => self::SHADOW_PRESETS_NOSHADOW, + 'effect' => NULL, + 'color' => array( + 'type' => self::EXCEL_COLOR_TYPE_STANDARD, + 'value' => 'black', + 'alpha' => 85, + ), + 'size' => array( + 'sx' => NULL, + 'sy' => NULL, + 'kx' => NULL + ), + 'blur' => NULL, + 'direction' => NULL, + 'distance' => NULL, + 'algn' => NULL, + 'rotWithShape' => NULL + ), + $_glow_properties = array( + 'size' => NULL, + 'color' => array( + 'type' => self::EXCEL_COLOR_TYPE_STANDARD, + 'value' => 'black', + 'alpha' => 40 + ) + ), + $_soft_edges = array( + 'size' => NULL + ); + + /** + * Get Object State + * + * @return bool + */ + + public function getObjectState() { + return $this->_object_state; + } + + /** + * Change Object State to True + * + * @return PHPExcel_Chart_GridLines + */ + + private function _activateObject() { + $this->_object_state = TRUE; + + return $this; + } + + /** + * Set Line Color Properties + * + * @param string $value + * @param int $alpha + * @param string $type + */ + + public function setLineColorProperties($value, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_STANDARD) { + $this + ->_activateObject() + ->_line_properties['color'] = $this->setColorProperties( + $value, + $alpha, + $type); + } + + /** + * Set Line Color Properties + * + * @param float $line_width + * @param string $compound_type + * @param string $dash_type + * @param string $cap_type + * @param string $join_type + * @param string $head_arrow_type + * @param string $head_arrow_size + * @param string $end_arrow_type + * @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) { + $this->_activateObject(); + (!is_null($line_width)) + ? $this->_line_properties['style']['width'] = $this->getExcelPointsWidth((float) $line_width) + : NULL; + (!is_null($compound_type)) + ? $this->_line_properties['style']['compound'] = (string) $compound_type + : NULL; + (!is_null($dash_type)) + ? $this->_line_properties['style']['dash'] = (string) $dash_type + : NULL; + (!is_null($cap_type)) + ? $this->_line_properties['style']['cap'] = (string) $cap_type + : NULL; + (!is_null($join_type)) + ? $this->_line_properties['style']['join'] = (string) $join_type + : NULL; + (!is_null($head_arrow_type)) + ? $this->_line_properties['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 + : NULL; + (!is_null($end_arrow_type)) + ? $this->_line_properties['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 + : NULL; + } + + /** + * Get Line Color Property + * + * @param string $parameter + * + * @return string + */ + + public function getLineColorProperty($parameter) { + return $this->_line_properties['color'][$parameter]; + } + + /** + * Get Line Style Property + * + * @param array|string $elements + * + * @return string + */ + + public function getLineStyleProperty($elements) { + return $this->getArrayElementsValue($this->_line_properties['style'], $elements); + } + + /** + * Set Glow Properties + * + * @param float $size + * @param string $color_value + * @param int $color_alpha + * @param string $color_type + * + */ + + public function setGlowProperties($size, $color_value = NULL, $color_alpha = NULL, $color_type = NULL) { + $this + ->_activateObject() + ->_setGlowSize($size) + ->_setGlowColor($color_value, $color_alpha, $color_type); + } + + /** + * Get Glow Color Property + * + * @param string $property + * + * @return string + */ + + public function getGlowColor($property) { + return $this->_glow_properties['color'][$property]; + } + + /** + * Get Glow Size + * + * @return string + */ + + public function getGlowSize() { + return $this->_glow_properties['size']; + } + + /** + * Set Glow Size + * + * @param float $size + * + * @return PHPExcel_Chart_GridLines + */ + + private function _setGlowSize($size) { + $this->_glow_properties['size'] = $this->getExcelPointsWidth((float) $size); + + return $this; + } + + /** + * Set Glow Color + * + * @param string $color + * @param int $alpha + * @param string $type + * + * @return PHPExcel_Chart_GridLines + */ + + private function _setGlowColor($color, $alpha, $type) { + if (!is_null($color)) { + $this->_glow_properties['color']['value'] = (string) $color; + } + if (!is_null($alpha)) { + $this->_glow_properties['color']['alpha'] = $this->getTrueAlpha((int) $alpha); + } + if (!is_null($type)) { + $this->_glow_properties['color']['type'] = (string) $type; + } + + return $this; + } + + /** + * Get Line Style Arrow Parameters + * + * @param string $arrow_selector + * @param string $property_selector + * + * @return string + */ + + public function getLineStyleArrowParameters($arrow_selector, $property_selector) { + return $this->getLineStyleArrowSize($this->_line_properties['style']['arrow'][$arrow_selector]['size'], $property_selector); + } + + /** + * Set Shadow Properties + * + * @param int $sh_presets + * @param string $sh_color_value + * @param string $sh_color_type + * @param int $sh_color_alpha + * @param string $sh_blur + * @param int $sh_angle + * @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 + ->_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); + } + + /** + * Set Shadow Presets Properties + * + * @param int $shadow_presets + * + * @return PHPExcel_Chart_GridLines + */ + + private function _setShadowPresetsProperties($shadow_presets) { + $this->_shadow_properties['presets'] = $shadow_presets; + $this->_setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); + + return $this; + } + + /** + * Set Shadow Properties Values + * + * @param array $properties_map + * @param * $reference + * + * @return PHPExcel_Chart_GridLines + */ + + 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]; + } else { + $reference = & $reference[$property_key]; + } + $this->_setShadowProperiesMapValues($property_val, $reference); + } else { + if ($base_reference === NULL) { + $this->_shadow_properties[$property_key] = $property_val; + } else { + $reference[$property_key] = $property_val; + } + } + } + + return $this; + } + + /** + * Set Shadow Color + * + * @param string $color + * @param int $alpha + * @param string $type + * + * @return PHPExcel_Chart_GridLines + */ + + private function _setShadowColor($color, $alpha, $type) { + if (!is_null($color)) { + $this->_shadow_properties['color']['value'] = (string) $color; + } + if (!is_null($alpha)) { + $this->_shadow_properties['color']['alpha'] = $this->getTrueAlpha((int) $alpha); + } + if (!is_null($type)) { + $this->_shadow_properties['color']['type'] = (string) $type; + } + + return $this; + } + + /** + * Set Shadow Blur + * + * @param float $blur + * + * @return PHPExcel_Chart_GridLines + */ + + private function _setShadowBlur($blur) { + if ($blur !== NULL) { + $this->_shadow_properties['blur'] = (string) $this->getExcelPointsWidth($blur); + } + + return $this; + } + + /** + * Set Shadow Angle + * + * @param int $angle + * + * @return PHPExcel_Chart_GridLines + */ + + private function _setShadowAngle($angle) { + if ($angle !== NULL) { + $this->_shadow_properties['direction'] = (string) $this->getExcelPointsAngle($angle); + } + + return $this; + } + + /** + * Set Shadow Distance + * + * @param float $distance + * + * @return PHPExcel_Chart_GridLines + */ + + private function _setShadowDistance($distance) { + if ($distance !== NULL) { + $this->_shadow_properties['distance'] = (string) $this->getExcelPointsWidth($distance); + } + + return $this; + } + + /** + * Get Shadow Property + * + * @param string $elements + * @param array $elements + * + * @return string + */ + + public function getShadowProperty($elements) { + return $this->getArrayElementsValue($this->_shadow_properties, $elements); + } + + /** + * Set Soft Edges Size + * + * @param float $size + */ + + public function setSoftEdgesSize($size) { + if (!is_null($size)) { + $this->_activateObject(); + $_soft_edges['size'] = (string) $this->getExcelPointsWidth($size); + } + } + + /** + * Get Soft Edges Size + * + * @return string + */ + + public function getSoftEdgesSize() { + return $this->_soft_edges['size']; + } +} \ No newline at end of file diff --git a/includes/PHPExcel/Classes/PHPExcel/Chart/Layout.php b/includes/PHPExcel/Classes/PHPExcel/Chart/Layout.php new file mode 100644 index 0000000..eefa157 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/Chart/Layout.php @@ -0,0 +1,445 @@ +_layoutTarget = $layout['layoutTarget']; } + if (isset($layout['xMode'])) { $this->_xMode = $layout['xMode']; } + if (isset($layout['yMode'])) { $this->_yMode = $layout['yMode']; } + if (isset($layout['x'])) { $this->_xPos = (float) $layout['x']; } + if (isset($layout['y'])) { $this->_yPos = (float) $layout['y']; } + if (isset($layout['w'])) { $this->_width = (float) $layout['w']; } + if (isset($layout['h'])) { $this->_height = (float) $layout['h']; } + } + + /** + * Get Layout Target + * + * @return string + */ + public function getLayoutTarget() { + return $this->_layoutTarget; + } + + /** + * Set Layout Target + * + * @param Layout Target $value + * @return PHPExcel_Chart_Layout + */ + public function setLayoutTarget($value) { + $this->_layoutTarget = $value; + return $this; + } + + /** + * Get X-Mode + * + * @return string + */ + public function getXMode() { + return $this->_xMode; + } + + /** + * Set X-Mode + * + * @param X-Mode $value + * @return PHPExcel_Chart_Layout + */ + public function setXMode($value) { + $this->_xMode = $value; + return $this; + } + + /** + * Get Y-Mode + * + * @return string + */ + public function getYMode() { + return $this->_yMode; + } + + /** + * Set Y-Mode + * + * @param Y-Mode $value + * @return PHPExcel_Chart_Layout + */ + public function setYMode($value) { + $this->_yMode = $value; + return $this; + } + + /** + * Get X-Position + * + * @return number + */ + public function getXPosition() { + return $this->_xPos; + } + + /** + * Set X-Position + * + * @param X-Position $value + * @return PHPExcel_Chart_Layout + */ + public function setXPosition($value) { + $this->_xPos = $value; + return $this; + } + + /** + * Get Y-Position + * + * @return number + */ + public function getYPosition() { + return $this->_yPos; + } + + /** + * Set Y-Position + * + * @param Y-Position $value + * @return PHPExcel_Chart_Layout + */ + public function setYPosition($value) { + $this->_yPos = $value; + return $this; + } + + /** + * Get Width + * + * @return number + */ + public function getWidth() { + return $this->_width; + } + + /** + * Set Width + * + * @param Width $value + * @return PHPExcel_Chart_Layout + */ + public function setWidth($value) { + $this->_width = $value; + return $this; + } + + /** + * Get Height + * + * @return number + */ + public function getHeight() { + return $this->_height; + } + + /** + * Set Height + * + * @param Height $value + * @return PHPExcel_Chart_Layout + */ + public function setHeight($value) { + $this->_height = $value; + return $this; + } + + + /** + * Get show legend key + * + * @return boolean + */ + public function getShowLegendKey() { + return $this->_showLegendKey; + } + + /** + * Set show legend key + * Specifies that legend keys should be shown in data labels. + * + * @param boolean $value Show legend key + * @return PHPExcel_Chart_Layout + */ + public function setShowLegendKey($value) { + $this->_showLegendKey = $value; + return $this; + } + + /** + * Get show value + * + * @return boolean + */ + public function getShowVal() { + return $this->_showVal; + } + + /** + * Set show val + * Specifies that the value should be shown in data labels. + * + * @param boolean $value Show val + * @return PHPExcel_Chart_Layout + */ + public function setShowVal($value) { + $this->_showVal = $value; + return $this; + } + + /** + * Get show category name + * + * @return boolean + */ + public function getShowCatName() { + return $this->_showCatName; + } + + /** + * Set show cat name + * Specifies that the category name should be shown in data labels. + * + * @param boolean $value Show cat name + * @return PHPExcel_Chart_Layout + */ + public function setShowCatName($value) { + $this->_showCatName = $value; + return $this; + } + + /** + * Get show data series name + * + * @return boolean + */ + public function getShowSerName() { + return $this->_showSerName; + } + + /** + * Set show ser name + * Specifies that the series name should be shown in data labels. + * + * @param boolean $value Show series name + * @return PHPExcel_Chart_Layout + */ + public function setShowSerName($value) { + $this->_showSerName = $value; + return $this; + } + + /** + * Get show percentage + * + * @return boolean + */ + public function getShowPercent() { + return $this->_showPercent; + } + + /** + * Set show percentage + * Specifies that the percentage should be shown in data labels. + * + * @param boolean $value Show percentage + * @return PHPExcel_Chart_Layout + */ + public function setShowPercent($value) { + $this->_showPercent = $value; + return $this; + } + + /** + * Get show bubble size + * + * @return boolean + */ + public function getShowBubbleSize() { + return $this->_showBubbleSize; + } + + /** + * Set show bubble size + * Specifies that the bubble size should be shown in data labels. + * + * @param boolean $value Show bubble size + * @return PHPExcel_Chart_Layout + */ + public function setShowBubbleSize($value) { + $this->_showBubbleSize = $value; + return $this; + } + + /** + * Get show leader lines + * + * @return boolean + */ + public function getShowLeaderLines() { + return $this->_showLeaderLines; + } + + /** + * Set show leader lines + * Specifies that leader lines should be shown in data labels. + * + * @param boolean $value Show leader lines + * @return PHPExcel_Chart_Layout + */ + public function setShowLeaderLines($value) { + $this->_showLeaderLines = $value; + return $this; + } + +} diff --git a/includes/PHPExcel/Classes/PHPExcel/Chart/Legend.php b/includes/PHPExcel/Classes/PHPExcel/Chart/Legend.php new file mode 100644 index 0000000..783b3d4 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/Chart/Legend.php @@ -0,0 +1,171 @@ + 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 + ); + + /** + * Legend position + * + * @var string + */ + private $_position = self::POSITION_RIGHT; + + /** + * Allow overlay of other elements? + * + * @var boolean + */ + private $_overlay = TRUE; + + /** + * Legend Layout + * + * @var PHPExcel_Chart_Layout + */ + private $_layout = NULL; + + + /** + * Create a new PHPExcel_Chart_Legend + */ + public function __construct($position = self::POSITION_RIGHT, PHPExcel_Chart_Layout $layout = NULL, $overlay = FALSE) + { + $this->setPosition($position); + $this->_layout = $layout; + $this->setOverlay($overlay); + } + + /** + * Get legend position as an excel string value + * + * @return string + */ + public function getPosition() { + return $this->_position; + } + + /** + * Get legend position using an excel string value + * + * @param string $position + */ + public function setPosition($position = self::POSITION_RIGHT) { + if (!in_array($position,self::$_positionXLref)) { + return false; + } + + $this->_position = $position; + return true; + } + + /** + * Get legend position as an Excel internal numeric value + * + * @return number + */ + public function getPositionXL() { + return array_search($this->_position,self::$_positionXLref); + } + + /** + * Set legend position using an Excel internal numeric value + * + * @param number $positionXL + */ + public function setPositionXL($positionXL = self::xlLegendPositionRight) { + if (!array_key_exists($positionXL,self::$_positionXLref)) { + return false; + } + + $this->_position = self::$_positionXLref[$positionXL]; + return true; + } + + /** + * Get allow overlay of other elements? + * + * @return boolean + */ + public function getOverlay() { + return $this->_overlay; + } + + /** + * Set allow overlay of other elements? + * + * @param boolean $overlay + * @return boolean + */ + public function setOverlay($overlay = FALSE) { + if (!is_bool($overlay)) { + return false; + } + + $this->_overlay = $overlay; + return true; + } + + /** + * Get Layout + * + * @return PHPExcel_Chart_Layout + */ + public function getLayout() { + return $this->_layout; + } + +} diff --git a/includes/PHPExcel/Classes/PHPExcel/Chart/PlotArea.php b/includes/PHPExcel/Classes/PHPExcel/Chart/PlotArea.php new file mode 100644 index 0000000..c917ce3 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/Chart/PlotArea.php @@ -0,0 +1,128 @@ +_layout = $layout; + $this->_plotSeries = $plotSeries; + } + + /** + * Get Layout + * + * @return PHPExcel_Chart_Layout + */ + public function getLayout() { + return $this->_layout; + } + + /** + * Get Number of Plot Groups + * + * @return array of PHPExcel_Chart_DataSeries + */ + public function getPlotGroupCount() { + return count($this->_plotSeries); + } + + /** + * Get Number of Plot Series + * + * @return integer + */ + public function getPlotSeriesCount() { + $seriesCount = 0; + foreach($this->_plotSeries as $plot) { + $seriesCount += $plot->getPlotSeriesCount(); + } + return $seriesCount; + } + + /** + * Get Plot Series + * + * @return array of PHPExcel_Chart_DataSeries + */ + public function getPlotGroup() { + return $this->_plotSeries; + } + + /** + * Get Plot Series by Index + * + * @return PHPExcel_Chart_DataSeries + */ + public function getPlotGroupByIndex($index) { + return $this->_plotSeries[$index]; + } + + /** + * Set Plot Series + * + * @param [PHPExcel_Chart_DataSeries] + * @return PHPExcel_Chart_PlotArea + */ + public function setPlotSeries($plotSeries = array()) { + $this->_plotSeries = $plotSeries; + + return $this; + } + + public function refresh(PHPExcel_Worksheet $worksheet) { + foreach($this->_plotSeries as $plotSeries) { + $plotSeries->refresh($worksheet); + } + } + +} diff --git a/includes/PHPExcel/Classes/PHPExcel/Chart/Properties.php b/includes/PHPExcel/Classes/PHPExcel/Chart/Properties.php new file mode 100644 index 0000000..7593983 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/Chart/Properties.php @@ -0,0 +1,359 @@ + (string) $type, + 'value' => (string) $color, + 'alpha' => (string) $this->getTrueAlpha($alpha) + ); + } + + protected function getLineStyleArrowSize($array_selector, $array_kay_selector) { + $sizes = array( + 1 => array('w' => 'sm', 'len' => 'sm'), + 2 => array('w' => 'sm', 'len' => 'med'), + 3 => array('w' => 'sm', 'len' => 'lg'), + 4 => array('w' => 'med', 'len' => 'sm'), + 5 => array('w' => 'med', 'len' => 'med'), + 6 => array('w' => 'med', 'len' => 'lg'), + 7 => array('w' => 'lg', 'len' => 'sm'), + 8 => array('w' => 'lg', 'len' => 'med'), + 9 => array('w' => 'lg', 'len' => 'lg') + ); + + return $sizes[$array_selector][$array_kay_selector]; + } + + protected function getShadowPresetsMap($shadow_presets_option) { + $presets_options = array( + //OUTER + 1 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '2700000', + 'algn' => 'tl', + 'rotWithShape' => '0' + ), + 2 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '5400000', + 'algn' => 't', + 'rotWithShape' => '0' + ), + 3 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '8100000', + 'algn' => 'tr', + 'rotWithShape' => '0' + ), + 4 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'algn' => 'l', + 'rotWithShape' => '0' + ), + 5 => array( + 'effect' => 'outerShdw', + 'size' => array( + 'sx' => '102000', + 'sy' => '102000' + ) + , + 'blur' => '63500', + 'distance' => '38100', + 'algn' => 'ctr', + 'rotWithShape' => '0' + ), + 6 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '10800000', + 'algn' => 'r', + 'rotWithShape' => '0' + ), + 7 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '18900000', + 'algn' => 'bl', + 'rotWithShape' => '0' + ), + 8 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '16200000', + 'rotWithShape' => '0' + ), + 9 => array( + 'effect' => 'outerShdw', + 'blur' => '50800', + 'distance' => '38100', + 'direction' => '13500000', + 'algn' => 'br', + 'rotWithShape' => '0' + ), + //INNER + 10 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '2700000', + ), + 11 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '5400000', + ), + 12 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '8100000', + ), + 13 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + ), + 14 => array( + 'effect' => 'innerShdw', + 'blur' => '114300', + ), + 15 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '10800000', + ), + 16 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '18900000', + ), + 17 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '16200000', + ), + 18 => array( + 'effect' => 'innerShdw', + 'blur' => '63500', + 'distance' => '50800', + 'direction' => '13500000', + ), + //perspective + 19 => array( + 'effect' => 'outerShdw', + 'blur' => '152400', + 'distance' => '317500', + 'size' => array( + 'sx' => '90000', + 'sy' => '-19000', + ), + 'direction' => '5400000', + 'rotWithShape' => '0', + ), + 20 => array( + 'effect' => 'outerShdw', + 'blur' => '76200', + 'direction' => '18900000', + 'size' => array( + 'sy' => '23000', + 'kx' => '-1200000', + ), + 'algn' => 'bl', + 'rotWithShape' => '0', + ), + 21 => array( + 'effect' => 'outerShdw', + 'blur' => '76200', + 'direction' => '13500000', + 'size' => array( + 'sy' => '23000', + 'kx' => '1200000', + ), + 'algn' => 'br', + 'rotWithShape' => '0', + ), + 22 => array( + 'effect' => 'outerShdw', + 'blur' => '76200', + 'distance' => '12700', + 'direction' => '2700000', + 'size' => array( + 'sy' => '-23000', + 'kx' => '-800400', + ), + 'algn' => 'bl', + 'rotWithShape' => '0', + ), + 23 => array( + 'effect' => 'outerShdw', + 'blur' => '76200', + 'distance' => '12700', + 'direction' => '8100000', + 'size' => array( + 'sy' => '-23000', + 'kx' => '800400', + ), + 'algn' => 'br', + 'rotWithShape' => '0', + ), + ); + + return $presets_options[$shadow_presets_option]; + } + + protected function getArrayElementsValue($properties, $elements) { + $reference = & $properties; + if (!is_array($elements)) { + return $reference[$elements]; + } else { + foreach ($elements as $keys) { + $reference = & $reference[$keys]; + } + + return $reference; + } + + return $this; + } + +} \ No newline at end of file diff --git a/includes/PHPExcel/Classes/PHPExcel/Chart/Title.php b/includes/PHPExcel/Classes/PHPExcel/Chart/Title.php new file mode 100644 index 0000000..5d226c4 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/Chart/Title.php @@ -0,0 +1,92 @@ +_caption = $caption; + $this->_layout = $layout; + } + + /** + * Get caption + * + * @return string + */ + public function getCaption() { + return $this->_caption; + } + + /** + * Set caption + * + * @param string $caption + * @return PHPExcel_Chart_Title + */ + public function setCaption($caption = null) { + $this->_caption = $caption; + + return $this; + } + + /** + * Get Layout + * + * @return PHPExcel_Chart_Layout + */ + public function getLayout() { + return $this->_layout; + } + +}