File tree 2 files changed +82
-0
lines changed
2 files changed +82
-0
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,35 @@ class Chart extends AbstractStyle
149
149
*/
150
150
private $ gridX = false ;
151
151
152
+ /**
153
+ * Min value for Y-Axis.
154
+ *
155
+ * @var float|int
156
+ */
157
+ private $ minY = 0 ;
158
+
159
+ /**
160
+ * Max value for X-Axis.
161
+ *
162
+ * @var float|int
163
+ */
164
+ private $ minX = 0 ;
165
+
166
+ /**
167
+ * Max value for Y-Axis.
168
+ *
169
+ * @var float|int
170
+ */
171
+ private $ maxY = 0 ;
172
+
173
+ /**
174
+ * Max value for X-Axis.
175
+ *
176
+ * @var float|int
177
+ */
178
+ private $ maxX = 0 ;
179
+
180
+
152
181
/**
153
182
* Create a new instance.
154
183
*
@@ -551,4 +580,45 @@ public function setShowGridX($value = true)
551
580
552
581
return $ this ;
553
582
}
583
+
584
+
585
+ public function minY (): float |int
586
+ {
587
+ return $ this ->minY ;
588
+ }
589
+
590
+ public function setMinY (float |int $ minY ): void
591
+ {
592
+ $ this ->minY = $ minY ;
593
+ }
594
+
595
+ public function minX (): float |int
596
+ {
597
+ return $ this ->minX ;
598
+ }
599
+
600
+ public function setMinX (float |int $ minX ): void
601
+ {
602
+ $ this ->minX = $ minX ;
603
+ }
604
+
605
+ public function maxY (): float |int
606
+ {
607
+ return $ this ->maxY ;
608
+ }
609
+
610
+ public function setMaxY (float |int $ maxY ): void
611
+ {
612
+ $ this ->maxY = $ maxY ;
613
+ }
614
+
615
+ public function maxX (): float |int
616
+ {
617
+ return $ this ->maxX ;
618
+ }
619
+
620
+ public function setMaxX (float |int $ maxX ): void
621
+ {
622
+ $ this ->maxX = $ maxX ;
623
+ }
554
624
}
Original file line number Diff line number Diff line change @@ -387,6 +387,18 @@ private function writeAxis(XMLWriter $xmlWriter, $type): void
387
387
388
388
$ xmlWriter ->startElement ('c:scaling ' );
389
389
$ xmlWriter ->writeElementBlock ('c:orientation ' , 'val ' , 'minMax ' );
390
+ if ($ type == 'cat ' && $ style ->minX ()) {
391
+ $ xmlWriter ->writeElementBlock ('c:min ' , 'val ' , $ style ->minX ());
392
+ }
393
+ if ($ type == 'cat ' && $ style ->maxX ()) {
394
+ $ xmlWriter ->writeElementBlock ('c:max ' , 'val ' , $ style ->maxX ());
395
+ }
396
+ if ($ type == 'val ' && $ style ->minY ()) {
397
+ $ xmlWriter ->writeElementBlock ('c:min ' , 'val ' , $ style ->minY ());
398
+ }
399
+ if ($ type == 'val ' && $ style ->maxY ()) {
400
+ $ xmlWriter ->writeElementBlock ('c:max ' , 'val ' , $ style ->maxY ());
401
+ }
390
402
$ xmlWriter ->endElement (); // c:scaling
391
403
392
404
$ this ->writeShape ($ xmlWriter , true );
You can’t perform that action at this time.
0 commit comments