Skip to content

Commit 350f38c

Browse files
authored
Merge branch 'master' into Calculation-Examples
2 parents 3884aa7 + adbda63 commit 350f38c

38 files changed

+366
-914
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 645 deletions
Large diffs are not rendered by default.

samples/Chart/33_Chart_create_scatter2.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use PhpOffice\PhpSpreadsheet\Chart\Axis;
3+
use PhpOffice\PhpSpreadsheet\Chart\Axis as ChartAxis;
44
use PhpOffice\PhpSpreadsheet\Chart\Chart;
55
use PhpOffice\PhpSpreadsheet\Chart\ChartColor;
66
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
@@ -121,12 +121,12 @@
121121
$dataSeriesValues[2]->setScatterLines(false); // points not connected
122122

123123
// Added so that Xaxis shows dates instead of Excel-equivalent-year1900-numbers
124-
$xAxis = new Axis();
124+
$xAxis = new ChartAxis();
125125
//$xAxis->setAxisNumberProperties(Properties::FORMAT_CODE_DATE );
126126
$xAxis->setAxisNumberProperties(Properties::FORMAT_CODE_DATE_ISO8601, true);
127127
$xAxis->setAxisOption('textRotation', '45');
128128

129-
$yAxis = new Axis();
129+
$yAxis = new ChartAxis();
130130
$yAxis->setLineStyleProperties(
131131
2.5, // width in points
132132
Properties::LINE_STYLE_COMPOUND_SIMPLE,

samples/Chart/33_Chart_create_scatter3.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use PhpOffice\PhpSpreadsheet\Chart\Axis;
3+
use PhpOffice\PhpSpreadsheet\Chart\Axis as ChartAxis;
44
use PhpOffice\PhpSpreadsheet\Chart\Chart;
55
use PhpOffice\PhpSpreadsheet\Chart\ChartColor;
66
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
@@ -121,13 +121,13 @@
121121
$dataSeriesValues[2]->setScatterLines(false); // points not connected
122122

123123
// Added so that Xaxis shows dates instead of Excel-equivalent-year1900-numbers
124-
$xAxis = new Axis();
124+
$xAxis = new ChartAxis();
125125
//$xAxis->setAxisNumberProperties(Properties::FORMAT_CODE_DATE );
126126
$xAxis->setAxisNumberProperties(Properties::FORMAT_CODE_DATE_ISO8601, true);
127127
$xAxis->setAxisOption('textRotation', '45');
128128
$xAxis->setAxisOption('hidden', '1');
129129

130-
$yAxis = new Axis();
130+
$yAxis = new ChartAxis();
131131
$yAxis->setLineStyleProperties(
132132
2.5, // width in points
133133
Properties::LINE_STYLE_COMPOUND_SIMPLE,

samples/Chart/33_Chart_create_scatter5_trendlines.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use PhpOffice\PhpSpreadsheet\Chart\Axis;
3+
use PhpOffice\PhpSpreadsheet\Chart\Axis as ChartAxis;
44
use PhpOffice\PhpSpreadsheet\Chart\Chart;
55
use PhpOffice\PhpSpreadsheet\Chart\ChartColor;
66
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
@@ -77,10 +77,10 @@
7777
// marker details
7878
$dataSeriesValues[0]
7979
->getMarkerFillColor()
80-
->setColorProperties('0070C0', null, ChartColor::EXCEL_COLOR_TYPE_ARGB);
80+
->setColorProperties('0070C0', null, ChartColor::EXCEL_COLOR_TYPE_RGB);
8181
$dataSeriesValues[0]
8282
->getMarkerBorderColor()
83-
->setColorProperties('002060', null, ChartColor::EXCEL_COLOR_TYPE_ARGB);
83+
->setColorProperties('002060', null, ChartColor::EXCEL_COLOR_TYPE_RGB);
8484

8585
// line details - dashed, smooth line (Bezier) with arrows, 40% transparent
8686
$dataSeriesValues[0]
@@ -105,24 +105,24 @@
105105
->setColorProperties('accent6', 3, ChartColor::EXCEL_COLOR_TYPE_SCHEME);
106106
$dataSeriesValues[1] // square marker fill color
107107
->getMarkerFillColor()
108-
->setColorProperties('0FFF00', null, ChartColor::EXCEL_COLOR_TYPE_ARGB);
108+
->setColorProperties('0FFF00', null, ChartColor::EXCEL_COLOR_TYPE_RGB);
109109
$dataSeriesValues[1]
110110
->setScatterLines(true)
111111
->setSmoothLine(false)
112-
->setLineColorProperties('FF0000', 80, ChartColor::EXCEL_COLOR_TYPE_ARGB);
112+
->setLineColorProperties('FF0000', 80, ChartColor::EXCEL_COLOR_TYPE_RGB);
113113
$dataSeriesValues[1]->setLineWidth(2.0);
114114

115115
// series 3 - metric3, markers, no line
116116
$dataSeriesValues[2] // triangle? fill
117117
//->setPointMarker('triangle') // let Excel choose shape, which is predicted to be a triangle
118118
->getMarkerFillColor()
119-
->setColorProperties('FFFF00', null, ChartColor::EXCEL_COLOR_TYPE_ARGB);
119+
->setColorProperties('FFFF00', null, ChartColor::EXCEL_COLOR_TYPE_RGB);
120120
$dataSeriesValues[2] // triangle border
121121
->getMarkerBorderColor()
122122
->setColorProperties('accent4', null, ChartColor::EXCEL_COLOR_TYPE_SCHEME);
123123
$dataSeriesValues[2]->setScatterLines(false); // points not connected
124124
// Added so that Xaxis shows dates instead of Excel-equivalent-year1900-numbers
125-
$xAxis = new Axis();
125+
$xAxis = new ChartAxis();
126126
$xAxis->setAxisNumberProperties(Properties::FORMAT_CODE_DATE_ISO8601, true);
127127

128128
// Build the dataseries
@@ -204,7 +204,7 @@
204204

205205
$dataSeriesValues[0]->setScatterLines(false); // points not connected
206206
$dataSeriesValues[0]->getMarkerFillColor()
207-
->setColorProperties('FFFF00', null, ChartColor::EXCEL_COLOR_TYPE_ARGB);
207+
->setColorProperties('FFFF00', null, ChartColor::EXCEL_COLOR_TYPE_RGB);
208208
$dataSeriesValues[0]->getMarkerBorderColor()
209209
->setColorProperties('accent4', null, ChartColor::EXCEL_COLOR_TYPE_SCHEME);
210210

@@ -218,7 +218,7 @@
218218
$dataSeriesValues[0]->getTrendLines()[2]->getLineColor()->setColorProperties('accent2', null, ChartColor::EXCEL_COLOR_TYPE_SCHEME);
219219
$dataSeriesValues[0]->getTrendLines()[2]->setLineStyleProperties(1.5, null, null, null, null, null, null, Properties::LINE_STYLE_ARROW_TYPE_OPEN, 8);
220220

221-
$xAxis = new Axis();
221+
$xAxis = new ChartAxis();
222222
$xAxis->setAxisNumberProperties(Properties::FORMAT_CODE_DATE_ISO8601); // m/d/yyyy
223223

224224
// Build the dataseries

src/PhpSpreadsheet/Chart/DataSeriesValues.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,13 @@ public function getFillColor()
324324
if (is_array($this->fillColor)) {
325325
$array = [];
326326
foreach ($this->fillColor as $chartColor) {
327-
$array[] = self::chartColorToString($chartColor);
327+
$array[] = $this->chartColorToString($chartColor);
328328
}
329329

330330
return $array;
331331
}
332332

333-
return self::chartColorToString($this->fillColor);
333+
return $this->chartColorToString($this->fillColor);
334334
}
335335

336336
/**
@@ -348,13 +348,13 @@ public function setFillColor($color)
348348
if ($fillString instanceof ChartColor) {
349349
$this->fillColor[] = $fillString;
350350
} else {
351-
$this->fillColor[] = self::stringToChartColor($fillString);
351+
$this->fillColor[] = $this->stringToChartColor($fillString);
352352
}
353353
}
354354
} elseif ($color instanceof ChartColor) {
355355
$this->fillColor = $color;
356-
} elseif (is_string($color)) {
357-
$this->fillColor = self::stringToChartColor($color);
356+
} else {
357+
$this->fillColor = $this->stringToChartColor($color);
358358
}
359359

360360
return $this;

0 commit comments

Comments
 (0)