提交的内容
This commit is contained in:
38
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php
vendored
Executable file → Normal file
38
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php
vendored
Executable file → Normal file
@ -52,6 +52,9 @@ class Axis extends Properties
|
||||
/** @var string */
|
||||
private $axisType = '';
|
||||
|
||||
/** @var ?AxisText */
|
||||
private $axisText;
|
||||
|
||||
/**
|
||||
* Axis Options.
|
||||
*
|
||||
@ -88,6 +91,9 @@ class Axis extends Properties
|
||||
Properties::FORMAT_CODE_DATE_ISO8601,
|
||||
];
|
||||
|
||||
/** @var bool */
|
||||
private $noFill = false;
|
||||
|
||||
/**
|
||||
* Get Series Data Type.
|
||||
*
|
||||
@ -183,6 +189,14 @@ class Axis extends Properties
|
||||
*/
|
||||
public function getAxisOptionsProperty($property)
|
||||
{
|
||||
if ($property === 'textRotation') {
|
||||
if ($this->axisText !== null) {
|
||||
if ($this->axisText->getRotation() !== null) {
|
||||
return (string) $this->axisText->getRotation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->axisOptions[$property];
|
||||
}
|
||||
|
||||
@ -295,4 +309,28 @@ class Axis extends Properties
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAxisText(): ?AxisText
|
||||
{
|
||||
return $this->axisText;
|
||||
}
|
||||
|
||||
public function setAxisText(?AxisText $axisText): self
|
||||
{
|
||||
$this->axisText = $axisText;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setNoFill(bool $noFill): self
|
||||
{
|
||||
$this->noFill = $noFill;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNoFill(): bool
|
||||
{
|
||||
return $this->noFill;
|
||||
}
|
||||
}
|
||||
|
||||
56
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/AxisText.php
vendored
Normal file
56
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/AxisText.php
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Style\Font;
|
||||
|
||||
class AxisText extends Properties
|
||||
{
|
||||
/** @var ?int */
|
||||
private $rotation;
|
||||
|
||||
/** @var Font */
|
||||
private $font;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->font = new Font();
|
||||
$this->font->setSize(null, true);
|
||||
}
|
||||
|
||||
public function setRotation(?int $rotation): self
|
||||
{
|
||||
$this->rotation = $rotation;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRotation(): ?int
|
||||
{
|
||||
return $this->rotation;
|
||||
}
|
||||
|
||||
public function getFillColorObject(): ChartColor
|
||||
{
|
||||
$fillColor = $this->font->getChartColor();
|
||||
if ($fillColor === null) {
|
||||
$fillColor = new ChartColor();
|
||||
$this->font->setChartColorFromObject($fillColor);
|
||||
}
|
||||
|
||||
return $fillColor;
|
||||
}
|
||||
|
||||
public function getFont(): Font
|
||||
{
|
||||
return $this->font;
|
||||
}
|
||||
|
||||
public function setFont(Font $font): self
|
||||
{
|
||||
$this->font = $font;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
25
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Chart.php
vendored
Executable file → Normal file
25
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Chart.php
vendored
Executable file → Normal file
@ -150,6 +150,12 @@ class Chart
|
||||
/** @var bool */
|
||||
private $roundedCorners = false;
|
||||
|
||||
/** @var GridLines */
|
||||
private $borderLines;
|
||||
|
||||
/** @var ChartColor */
|
||||
private $fillColor;
|
||||
|
||||
/**
|
||||
* Create a new Chart.
|
||||
* majorGridlines and minorGridlines are deprecated, moved to Axis.
|
||||
@ -176,6 +182,8 @@ class Chart
|
||||
if ($minorGridlines !== null) {
|
||||
$this->yAxis->setMinorGridlines($minorGridlines);
|
||||
}
|
||||
$this->fillColor = new ChartColor();
|
||||
$this->borderLines = new GridLines();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -786,4 +794,21 @@ class Chart
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBorderLines(): GridLines
|
||||
{
|
||||
return $this->borderLines;
|
||||
}
|
||||
|
||||
public function setBorderLines(GridLines $borderLines): self
|
||||
{
|
||||
$this->borderLines = $borderLines;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFillColor(): ChartColor
|
||||
{
|
||||
return $this->fillColor;
|
||||
}
|
||||
}
|
||||
|
||||
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/ChartColor.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/ChartColor.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeries.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeries.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeriesValues.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeriesValues.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Exception.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Exception.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/GridLines.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/GridLines.php
vendored
Executable file → Normal file
44
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php
vendored
Executable file → Normal file
44
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php
vendored
Executable file → Normal file
@ -2,6 +2,8 @@
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Style\Font;
|
||||
|
||||
class Layout
|
||||
{
|
||||
/**
|
||||
@ -127,8 +129,11 @@ class Layout
|
||||
/** @var ?ChartColor */
|
||||
private $labelBorderColor;
|
||||
|
||||
/** @var ?ChartColor */
|
||||
private $labelFontColor;
|
||||
/** @var ?Font */
|
||||
private $labelFont;
|
||||
|
||||
/** @var Properties */
|
||||
private $labelEffects;
|
||||
|
||||
/**
|
||||
* Create a new Layout.
|
||||
@ -172,7 +177,18 @@ class Layout
|
||||
$this->initBoolean($layout, 'numFmtLinked');
|
||||
$this->initColor($layout, 'labelFillColor');
|
||||
$this->initColor($layout, 'labelBorderColor');
|
||||
$this->initColor($layout, 'labelFontColor');
|
||||
$labelFont = $layout['labelFont'] ?? null;
|
||||
if ($labelFont instanceof Font) {
|
||||
$this->labelFont = $labelFont;
|
||||
}
|
||||
$labelFontColor = $layout['labelFontColor'] ?? null;
|
||||
if ($labelFontColor instanceof ChartColor) {
|
||||
$this->setLabelFontColor($labelFontColor);
|
||||
}
|
||||
$labelEffects = $layout['labelEffects'] ?? null;
|
||||
if ($labelEffects instanceof Properties) {
|
||||
$this->labelEffects = $labelEffects;
|
||||
}
|
||||
}
|
||||
|
||||
private function initBoolean(array $layout, string $name): void
|
||||
@ -493,14 +509,32 @@ class Layout
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLabelFont(): ?Font
|
||||
{
|
||||
return $this->labelFont;
|
||||
}
|
||||
|
||||
public function getLabelEffects(): ?Properties
|
||||
{
|
||||
return $this->labelEffects;
|
||||
}
|
||||
|
||||
public function getLabelFontColor(): ?ChartColor
|
||||
{
|
||||
return $this->labelFontColor;
|
||||
if ($this->labelFont === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->labelFont->getChartColor();
|
||||
}
|
||||
|
||||
public function setLabelFontColor(?ChartColor $chartColor): self
|
||||
{
|
||||
$this->labelFontColor = $chartColor;
|
||||
if ($this->labelFont === null) {
|
||||
$this->labelFont = new Font();
|
||||
$this->labelFont->setSize(null, true);
|
||||
}
|
||||
$this->labelFont->setChartColorFromObject($chartColor);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
40
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php
vendored
Executable file → Normal file
40
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php
vendored
Executable file → Normal file
@ -48,6 +48,15 @@ class Legend
|
||||
*/
|
||||
private $layout;
|
||||
|
||||
/** @var GridLines */
|
||||
private $borderLines;
|
||||
|
||||
/** @var ChartColor */
|
||||
private $fillColor;
|
||||
|
||||
/** @var ?AxisText */
|
||||
private $legendText;
|
||||
|
||||
/**
|
||||
* Create a new Legend.
|
||||
*
|
||||
@ -60,6 +69,13 @@ class Legend
|
||||
$this->setPosition($position);
|
||||
$this->layout = $layout;
|
||||
$this->setOverlay($overlay);
|
||||
$this->borderLines = new GridLines();
|
||||
$this->fillColor = new ChartColor();
|
||||
}
|
||||
|
||||
public function getFillColor(): ChartColor
|
||||
{
|
||||
return $this->fillColor;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -148,4 +164,28 @@ class Legend
|
||||
{
|
||||
return $this->layout;
|
||||
}
|
||||
|
||||
public function getLegendText(): ?AxisText
|
||||
{
|
||||
return $this->legendText;
|
||||
}
|
||||
|
||||
public function setLegendText(?AxisText $legendText): self
|
||||
{
|
||||
$this->legendText = $legendText;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBorderLines(): GridLines
|
||||
{
|
||||
return $this->borderLines;
|
||||
}
|
||||
|
||||
public function setBorderLines(GridLines $borderLines): self
|
||||
{
|
||||
$this->borderLines = $borderLines;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
45
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/PlotArea.php
vendored
Executable file → Normal file
45
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/PlotArea.php
vendored
Executable file → Normal file
@ -163,4 +163,49 @@ class PlotArea
|
||||
{
|
||||
return $this->gradientFillStops;
|
||||
}
|
||||
|
||||
/** @var ?int */
|
||||
private $gapWidth;
|
||||
|
||||
/** @var bool */
|
||||
private $useUpBars = false;
|
||||
|
||||
/** @var bool */
|
||||
private $useDownBars = false;
|
||||
|
||||
public function getGapWidth(): ?int
|
||||
{
|
||||
return $this->gapWidth;
|
||||
}
|
||||
|
||||
public function setGapWidth(?int $gapWidth): self
|
||||
{
|
||||
$this->gapWidth = $gapWidth;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUseUpBars(): bool
|
||||
{
|
||||
return $this->useUpBars;
|
||||
}
|
||||
|
||||
public function setUseUpBars(bool $useUpBars): self
|
||||
{
|
||||
$this->useUpBars = $useUpBars;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUseDownBars(): bool
|
||||
{
|
||||
return $this->useDownBars;
|
||||
}
|
||||
|
||||
public function setUseDownBars(bool $useDownBars): self
|
||||
{
|
||||
$this->useDownBars = $useDownBars;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Properties.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Properties.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/IRenderer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/IRenderer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php
vendored
Executable file → Normal file
29
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php
vendored
Executable file → Normal file
29
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php
vendored
Executable file → Normal file
@ -434,12 +434,33 @@ abstract class JpGraphRendererBase implements IRenderer
|
||||
|
||||
// Loop through each data series in turn
|
||||
for ($i = 0; $i < $seriesCount; ++$i) {
|
||||
$dataValuesY = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues();
|
||||
$plotCategoryByIndex = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i);
|
||||
if ($plotCategoryByIndex === false) {
|
||||
$plotCategoryByIndex = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0);
|
||||
}
|
||||
$dataValuesY = $plotCategoryByIndex->getDataValues();
|
||||
$dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
|
||||
|
||||
foreach ($dataValuesY as $k => $dataValueY) {
|
||||
$dataValuesY[$k] = $k;
|
||||
$redoDataValuesY = true;
|
||||
if ($bubble) {
|
||||
if (!$bubbleSize) {
|
||||
$bubbleSize = '10';
|
||||
}
|
||||
$redoDataValuesY = false;
|
||||
foreach ($dataValuesY as $dataValueY) {
|
||||
if (!is_int($dataValueY) && !is_float($dataValueY)) {
|
||||
$redoDataValuesY = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($redoDataValuesY) {
|
||||
foreach ($dataValuesY as $k => $dataValueY) {
|
||||
$dataValuesY[$k] = $k;
|
||||
}
|
||||
}
|
||||
//var_dump($dataValuesY, $dataValuesX, $bubbleSize);
|
||||
|
||||
$seriesPlot = new ScatterPlot($dataValuesX, $dataValuesY);
|
||||
if ($scatterStyle == 'lineMarker') {
|
||||
@ -483,7 +504,7 @@ abstract class JpGraphRendererBase implements IRenderer
|
||||
|
||||
$dataValues = [];
|
||||
foreach ($dataValuesY as $k => $dataValueY) {
|
||||
$dataValues[$k] = implode(' ', array_reverse($dataValueY));
|
||||
$dataValues[$k] = is_array($dataValueY) ? implode(' ', array_reverse($dataValueY)) : $dataValueY;
|
||||
}
|
||||
$tmp = array_shift($dataValues);
|
||||
$dataValues[] = $tmp;
|
||||
|
||||
6
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/MtJpGraphRenderer.php
vendored
Executable file → Normal file
6
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/MtJpGraphRenderer.php
vendored
Executable file → Normal file
@ -3,12 +3,12 @@
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart\Renderer;
|
||||
|
||||
/**
|
||||
* Jpgraph is not oficially maintained in Composer.
|
||||
* Jpgraph is not officially maintained by Composer at packagist.org.
|
||||
*
|
||||
* This renderer implementation uses package
|
||||
* https://packagist.org/packages/mitoteam/jpgraph
|
||||
*
|
||||
* This package is up to date for August 2022 and has PHP 8.1 support.
|
||||
* This package is up to date for June 2023 and has PHP 8.2 support.
|
||||
*/
|
||||
class MtJpGraphRenderer extends JpGraphRendererBase
|
||||
{
|
||||
@ -29,7 +29,7 @@ class MtJpGraphRenderer extends JpGraphRendererBase
|
||||
'regstat',
|
||||
'scatter',
|
||||
'stock',
|
||||
]);
|
||||
], true); // enable Extended mode
|
||||
|
||||
$loaded = true;
|
||||
}
|
||||
|
||||
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/TrendLine.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/TrendLine.php
vendored
Executable file → Normal file
Reference in New Issue
Block a user