@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | date_default_timezone_set('Europe/London'); |
33 | 33 | |
34 | 34 | if (PHP_SAPI == 'cli') |
35 | - die('This example should only be run from a Web Browser'); |
|
35 | + die('This example should only be run from a Web Browser'); |
|
36 | 36 | |
37 | 37 | /** Include PHPExcel */ |
38 | 38 | require_once dirname(__FILE__) . '/../src/Bootstrap.php'; |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | |
44 | 44 | // Set document properties |
45 | 45 | $objPHPExcel->getProperties()->setCreator("Maarten Balliauw") |
46 | - ->setLastModifiedBy("Maarten Balliauw") |
|
47 | - ->setTitle("Office 2007 XLSX Test Document") |
|
48 | - ->setSubject("Office 2007 XLSX Test Document") |
|
49 | - ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
50 | - ->setKeywords("office 2007 openxml php") |
|
51 | - ->setCategory("Test result file"); |
|
46 | + ->setLastModifiedBy("Maarten Balliauw") |
|
47 | + ->setTitle("Office 2007 XLSX Test Document") |
|
48 | + ->setSubject("Office 2007 XLSX Test Document") |
|
49 | + ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
50 | + ->setKeywords("office 2007 openxml php") |
|
51 | + ->setCategory("Test result file"); |
|
52 | 52 | |
53 | 53 | |
54 | 54 | // Add some data |
@@ -43,21 +43,21 @@ discard block |
||
43 | 43 | $objPHPExcel = new \PHPExcel\Spreadsheet(); |
44 | 44 | $objWorksheet = $objPHPExcel->getActiveSheet(); |
45 | 45 | $objWorksheet->fromArray( |
46 | - array( |
|
47 | - array('', 2010, 2011, 2012), |
|
48 | - array('Jan', 47, 45, 71), |
|
49 | - array('Feb', 56, 73, 86), |
|
50 | - array('Mar', 52, 61, 69), |
|
51 | - array('Apr', 40, 52, 60), |
|
52 | - array('May', 42, 55, 71), |
|
53 | - array('Jun', 58, 63, 76), |
|
54 | - array('Jul', 53, 61, 89), |
|
55 | - array('Aug', 46, 69, 85), |
|
56 | - array('Sep', 62, 75, 81), |
|
57 | - array('Oct', 51, 70, 96), |
|
58 | - array('Nov', 55, 66, 89), |
|
59 | - array('Dec', 68, 62, 0), |
|
60 | - ) |
|
46 | + array( |
|
47 | + array('', 2010, 2011, 2012), |
|
48 | + array('Jan', 47, 45, 71), |
|
49 | + array('Feb', 56, 73, 86), |
|
50 | + array('Mar', 52, 61, 69), |
|
51 | + array('Apr', 40, 52, 60), |
|
52 | + array('May', 42, 55, 71), |
|
53 | + array('Jun', 58, 63, 76), |
|
54 | + array('Jul', 53, 61, 89), |
|
55 | + array('Aug', 46, 69, 85), |
|
56 | + array('Sep', 62, 75, 81), |
|
57 | + array('Oct', 51, 70, 96), |
|
58 | + array('Nov', 55, 66, 89), |
|
59 | + array('Dec', 68, 62, 0), |
|
60 | + ) |
|
61 | 61 | ); |
62 | 62 | |
63 | 63 | |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | // Data values |
70 | 70 | // Data Marker |
71 | 71 | $dataSeriesLabels = array( |
72 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), // 2011 |
|
73 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), // 2012 |
|
72 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), // 2011 |
|
73 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), // 2012 |
|
74 | 74 | ); |
75 | 75 | // Set the X-Axis Labels |
76 | 76 | // Datatype |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | // Data values |
81 | 81 | // Data Marker |
82 | 82 | $xAxisTickValues = array( |
83 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12), // Jan to Dec |
|
84 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12), // Jan to Dec |
|
83 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12), // Jan to Dec |
|
84 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12), // Jan to Dec |
|
85 | 85 | ); |
86 | 86 | // Set the Data values for each data series we want to plot |
87 | 87 | // Datatype |
@@ -91,21 +91,21 @@ discard block |
||
91 | 91 | // Data values |
92 | 92 | // Data Marker |
93 | 93 | $dataSeriesValues = array( |
94 | - new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', NULL, 12), |
|
95 | - new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', NULL, 12), |
|
94 | + new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', NULL, 12), |
|
95 | + new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', NULL, 12), |
|
96 | 96 | ); |
97 | 97 | |
98 | 98 | // Build the dataseries |
99 | 99 | $series = new \PHPExcel\Chart\DataSeries( |
100 | - \PHPExcel\Chart\DataSeries::TYPE_RADARCHART, // plotType |
|
101 | - NULL, // plotGrouping (Radar charts don't have any grouping) |
|
102 | - range(0, count($dataSeriesValues)-1), // plotOrder |
|
103 | - $dataSeriesLabels, // plotLabel |
|
104 | - $xAxisTickValues, // plotCategory |
|
105 | - $dataSeriesValues, // plotValues |
|
100 | + \PHPExcel\Chart\DataSeries::TYPE_RADARCHART, // plotType |
|
101 | + NULL, // plotGrouping (Radar charts don't have any grouping) |
|
102 | + range(0, count($dataSeriesValues)-1), // plotOrder |
|
103 | + $dataSeriesLabels, // plotLabel |
|
104 | + $xAxisTickValues, // plotCategory |
|
105 | + $dataSeriesValues, // plotValues |
|
106 | 106 | NULL, // plotDirection |
107 | - NULL, // smooth line |
|
108 | - \PHPExcel\Chart\DataSeries::STYLE_MARKER // plotStyle |
|
107 | + NULL, // smooth line |
|
108 | + \PHPExcel\Chart\DataSeries::STYLE_MARKER // plotStyle |
|
109 | 109 | ); |
110 | 110 | |
111 | 111 | // Set up a layout object for the Pie chart |
@@ -121,14 +121,14 @@ discard block |
||
121 | 121 | |
122 | 122 | // Create the chart |
123 | 123 | $chart = new \PHPExcel\Chart( |
124 | - 'chart1', // name |
|
125 | - $title, // title |
|
126 | - $legend, // legend |
|
127 | - $plotArea, // plotArea |
|
128 | - true, // plotVisibleOnly |
|
129 | - 0, // displayBlanksAs |
|
130 | - NULL, // xAxisLabel |
|
131 | - NULL // yAxisLabel - Radar charts don't have a Y-Axis |
|
124 | + 'chart1', // name |
|
125 | + $title, // title |
|
126 | + $legend, // legend |
|
127 | + $plotArea, // plotArea |
|
128 | + true, // plotVisibleOnly |
|
129 | + 0, // displayBlanksAs |
|
130 | + NULL, // xAxisLabel |
|
131 | + NULL // yAxisLabel - Radar charts don't have a Y-Axis |
|
132 | 132 | ); |
133 | 133 | |
134 | 134 | // Set the position where the chart should appear in the worksheet |
@@ -13,8 +13,8 @@ |
||
13 | 13 | ->disableOriginalConstructor() |
14 | 14 | ->getMock(); |
15 | 15 | $this->mockWorksheet->expects($this->any()) |
16 | - ->method('getHighestRow') |
|
17 | - ->will($this->returnValue(5)); |
|
16 | + ->method('getHighestRow') |
|
17 | + ->will($this->returnValue(5)); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 |
@@ -18,11 +18,11 @@ |
||
18 | 18 | ->getMock(); |
19 | 19 | |
20 | 20 | $this->mockWorksheet->expects($this->any()) |
21 | - ->method('getHighestColumn') |
|
22 | - ->will($this->returnValue('E')); |
|
21 | + ->method('getHighestColumn') |
|
22 | + ->will($this->returnValue('E')); |
|
23 | 23 | $this->mockWorksheet->expects($this->any()) |
24 | - ->method('current') |
|
25 | - ->will($this->returnValue($this->mockColumn)); |
|
24 | + ->method('current') |
|
25 | + ->will($this->returnValue($this->mockColumn)); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 |
@@ -18,11 +18,11 @@ |
||
18 | 18 | ->getMock(); |
19 | 19 | |
20 | 20 | $this->mockWorksheet->expects($this->any()) |
21 | - ->method('getHighestRow') |
|
22 | - ->will($this->returnValue(5)); |
|
21 | + ->method('getHighestRow') |
|
22 | + ->will($this->returnValue(5)); |
|
23 | 23 | $this->mockWorksheet->expects($this->any()) |
24 | - ->method('getCellByColumnAndRow') |
|
25 | - ->will($this->returnValue($this->mockCell)); |
|
24 | + ->method('getCellByColumnAndRow') |
|
25 | + ->will($this->returnValue($this->mockCell)); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $attributeSet = array( 'val' => 100, |
113 | 113 | 'maxVal' => 200 |
114 | - ); |
|
114 | + ); |
|
115 | 115 | |
116 | 116 | // Setters return the instance to implement the fluent interface |
117 | 117 | $result = $this->_testAutoFilterColumnObject->setAttributes($attributeSet); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | $attributeSet = array( 'val' => 100, |
124 | 124 | 'maxVal' => 200 |
125 | - ); |
|
125 | + ); |
|
126 | 126 | |
127 | 127 | $this->_testAutoFilterColumnObject->setAttributes($attributeSet); |
128 | 128 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | $attributeSet = array( 'val' => 100, |
137 | 137 | 'maxVal' => 200 |
138 | - ); |
|
138 | + ); |
|
139 | 139 | |
140 | 140 | foreach ($attributeSet as $attributeName => $attributeValue) { |
141 | 141 | // Setters return the instance to implement the fluent interface |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | { |
149 | 149 | $attributeSet = array( 'val' => 100, |
150 | 150 | 'maxVal' => 200 |
151 | - ); |
|
151 | + ); |
|
152 | 152 | |
153 | 153 | $this->_testAutoFilterColumnObject->setAttributes($attributeSet); |
154 | 154 |
@@ -18,11 +18,11 @@ |
||
18 | 18 | ->getMock(); |
19 | 19 | |
20 | 20 | $this->mockWorksheet->expects($this->any()) |
21 | - ->method('getHighestRow') |
|
22 | - ->will($this->returnValue(5)); |
|
21 | + ->method('getHighestRow') |
|
22 | + ->will($this->returnValue(5)); |
|
23 | 23 | $this->mockWorksheet->expects($this->any()) |
24 | - ->method('current') |
|
25 | - ->will($this->returnValue($this->mockRow)); |
|
24 | + ->method('current') |
|
25 | + ->will($this->returnValue($this->mockRow)); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 |
@@ -18,11 +18,11 @@ |
||
18 | 18 | ->getMock(); |
19 | 19 | |
20 | 20 | $this->mockWorksheet->expects($this->any()) |
21 | - ->method('getHighestColumn') |
|
22 | - ->will($this->returnValue('E')); |
|
21 | + ->method('getHighestColumn') |
|
22 | + ->will($this->returnValue('E')); |
|
23 | 23 | $this->mockWorksheet->expects($this->any()) |
24 | - ->method('getCellByColumnAndRow') |
|
25 | - ->will($this->returnValue($this->mockCell)); |
|
24 | + ->method('getCellByColumnAndRow') |
|
25 | + ->will($this->returnValue($this->mockCell)); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 |
@@ -13,8 +13,8 @@ |
||
13 | 13 | ->disableOriginalConstructor() |
14 | 14 | ->getMock(); |
15 | 15 | $this->mockWorksheet->expects($this->any()) |
16 | - ->method('getHighestColumn') |
|
17 | - ->will($this->returnValue('E')); |
|
16 | + ->method('getHighestColumn') |
|
17 | + ->will($this->returnValue('E')); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 |