|
1 | 1 | <?php
|
2 | 2 |
|
3 |
| -use PhpOffice\PhpSpreadsheet\Chart\Axis; |
| 3 | +use PhpOffice\PhpSpreadsheet\Chart\Axis as ChartAxis; |
4 | 4 | use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
5 | 5 | use PhpOffice\PhpSpreadsheet\Chart\ChartColor;
|
6 | 6 | use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
|
77 | 77 | // marker details
|
78 | 78 | $dataSeriesValues[0]
|
79 | 79 | ->getMarkerFillColor()
|
80 |
| - ->setColorProperties('0070C0', null, ChartColor::EXCEL_COLOR_TYPE_ARGB); |
| 80 | + ->setColorProperties('0070C0', null, ChartColor::EXCEL_COLOR_TYPE_RGB); |
81 | 81 | $dataSeriesValues[0]
|
82 | 82 | ->getMarkerBorderColor()
|
83 |
| - ->setColorProperties('002060', null, ChartColor::EXCEL_COLOR_TYPE_ARGB); |
| 83 | + ->setColorProperties('002060', null, ChartColor::EXCEL_COLOR_TYPE_RGB); |
84 | 84 |
|
85 | 85 | // line details - dashed, smooth line (Bezier) with arrows, 40% transparent
|
86 | 86 | $dataSeriesValues[0]
|
|
105 | 105 | ->setColorProperties('accent6', 3, ChartColor::EXCEL_COLOR_TYPE_SCHEME);
|
106 | 106 | $dataSeriesValues[1] // square marker fill color
|
107 | 107 | ->getMarkerFillColor()
|
108 |
| - ->setColorProperties('0FFF00', null, ChartColor::EXCEL_COLOR_TYPE_ARGB); |
| 108 | + ->setColorProperties('0FFF00', null, ChartColor::EXCEL_COLOR_TYPE_RGB); |
109 | 109 | $dataSeriesValues[1]
|
110 | 110 | ->setScatterLines(true)
|
111 | 111 | ->setSmoothLine(false)
|
112 |
| - ->setLineColorProperties('FF0000', 80, ChartColor::EXCEL_COLOR_TYPE_ARGB); |
| 112 | + ->setLineColorProperties('FF0000', 80, ChartColor::EXCEL_COLOR_TYPE_RGB); |
113 | 113 | $dataSeriesValues[1]->setLineWidth(2.0);
|
114 | 114 |
|
115 | 115 | // series 3 - metric3, markers, no line
|
116 | 116 | $dataSeriesValues[2] // triangle? fill
|
117 | 117 | //->setPointMarker('triangle') // let Excel choose shape, which is predicted to be a triangle
|
118 | 118 | ->getMarkerFillColor()
|
119 |
| - ->setColorProperties('FFFF00', null, ChartColor::EXCEL_COLOR_TYPE_ARGB); |
| 119 | + ->setColorProperties('FFFF00', null, ChartColor::EXCEL_COLOR_TYPE_RGB); |
120 | 120 | $dataSeriesValues[2] // triangle border
|
121 | 121 | ->getMarkerBorderColor()
|
122 | 122 | ->setColorProperties('accent4', null, ChartColor::EXCEL_COLOR_TYPE_SCHEME);
|
123 | 123 | $dataSeriesValues[2]->setScatterLines(false); // points not connected
|
124 | 124 | // Added so that Xaxis shows dates instead of Excel-equivalent-year1900-numbers
|
125 |
| -$xAxis = new Axis(); |
| 125 | +$xAxis = new ChartAxis(); |
126 | 126 | $xAxis->setAxisNumberProperties(Properties::FORMAT_CODE_DATE_ISO8601, true);
|
127 | 127 |
|
128 | 128 | // Build the dataseries
|
|
204 | 204 |
|
205 | 205 | $dataSeriesValues[0]->setScatterLines(false); // points not connected
|
206 | 206 | $dataSeriesValues[0]->getMarkerFillColor()
|
207 |
| - ->setColorProperties('FFFF00', null, ChartColor::EXCEL_COLOR_TYPE_ARGB); |
| 207 | + ->setColorProperties('FFFF00', null, ChartColor::EXCEL_COLOR_TYPE_RGB); |
208 | 208 | $dataSeriesValues[0]->getMarkerBorderColor()
|
209 | 209 | ->setColorProperties('accent4', null, ChartColor::EXCEL_COLOR_TYPE_SCHEME);
|
210 | 210 |
|
|
218 | 218 | $dataSeriesValues[0]->getTrendLines()[2]->getLineColor()->setColorProperties('accent2', null, ChartColor::EXCEL_COLOR_TYPE_SCHEME);
|
219 | 219 | $dataSeriesValues[0]->getTrendLines()[2]->setLineStyleProperties(1.5, null, null, null, null, null, null, Properties::LINE_STYLE_ARROW_TYPE_OPEN, 8);
|
220 | 220 |
|
221 |
| -$xAxis = new Axis(); |
| 221 | +$xAxis = new ChartAxis(); |
222 | 222 | $xAxis->setAxisNumberProperties(Properties::FORMAT_CODE_DATE_ISO8601); // m/d/yyyy
|
223 | 223 |
|
224 | 224 | // Build the dataseries
|
|
0 commit comments