File tree Expand file tree Collapse file tree 2 files changed +112
-0
lines changed Expand file tree Collapse file tree 2 files changed +112
-0
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,34 @@ class Chart extends AbstractStyle
149
149
*/
150
150
private $ gridX = false ;
151
151
152
+ /**
153
+ * Min value for Y-Axis.
154
+ *
155
+ * @var null|float|int
156
+ */
157
+ private $ minY ;
158
+
159
+ /**
160
+ * Max value for X-Axis.
161
+ *
162
+ * @var null|float|int
163
+ */
164
+ private $ minX ;
165
+
166
+ /**
167
+ * Max value for Y-Axis.
168
+ *
169
+ * @var null|float|int
170
+ */
171
+ private $ maxY ;
172
+
173
+ /**
174
+ * Max value for X-Axis.
175
+ *
176
+ * @var null|float|int
177
+ */
178
+ private $ maxX ;
179
+
152
180
/**
153
181
* Create a new instance.
154
182
*
@@ -551,4 +579,68 @@ public function setShowGridX($value = true)
551
579
552
580
return $ this ;
553
581
}
582
+
583
+ /**
584
+ * @return null|float|int
585
+ */
586
+ public function minY ()
587
+ {
588
+ return $ this ->minY ;
589
+ }
590
+
591
+ /**
592
+ * @param null|float|int $minY
593
+ */
594
+ public function setMinY ($ minY ): void
595
+ {
596
+ $ this ->minY = $ minY ;
597
+ }
598
+
599
+ /**
600
+ * @return null|float|int
601
+ */
602
+ public function minX ()
603
+ {
604
+ return $ this ->minX ;
605
+ }
606
+
607
+ /**
608
+ * @param null|float|int $minX
609
+ */
610
+ public function setMinX ($ minX ): void
611
+ {
612
+ $ this ->minX = $ minX ;
613
+ }
614
+
615
+ /**
616
+ * @return null|float|int
617
+ */
618
+ public function maxY ()
619
+ {
620
+ return $ this ->maxY ;
621
+ }
622
+
623
+ /**
624
+ * @param null|float|int $maxY
625
+ */
626
+ public function setMaxY ($ maxY ): void
627
+ {
628
+ $ this ->maxY = $ maxY ;
629
+ }
630
+
631
+ /**
632
+ * @return null|float|int
633
+ */
634
+ public function maxX ()
635
+ {
636
+ return $ this ->maxX ;
637
+ }
638
+
639
+ /**
640
+ * @param null|float|int $maxX
641
+ */
642
+ public function setMaxX ($ maxX ): void
643
+ {
644
+ $ this ->maxX = $ maxX ;
645
+ }
554
646
}
Original file line number Diff line number Diff line change @@ -387,6 +387,26 @@ 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 ->startElement ('c:min ' );
392
+ $ xmlWriter ->writeAttribute ('val ' , $ style ->minX ());
393
+ $ xmlWriter ->endElement ();
394
+ }
395
+ if ($ type == 'cat ' && $ style ->maxX ()) {
396
+ $ xmlWriter ->startElement ('c:max ' );
397
+ $ xmlWriter ->writeAttribute ('val ' , $ style ->maxX ());
398
+ $ xmlWriter ->endElement ();
399
+ }
400
+ if ($ type == 'val ' && $ style ->minY ()) {
401
+ $ xmlWriter ->startElement ('c:min ' );
402
+ $ xmlWriter ->writeAttribute ('val ' , $ style ->minY ());
403
+ $ xmlWriter ->endElement ();
404
+ }
405
+ if ($ type == 'val ' && $ style ->maxY ()) {
406
+ $ xmlWriter ->startElement ('c:max ' );
407
+ $ xmlWriter ->writeAttribute ('val ' , $ style ->maxY ());
408
+ $ xmlWriter ->endElement ();
409
+ }
390
410
$ xmlWriter ->endElement (); // c:scaling
391
411
392
412
$ this ->writeShape ($ xmlWriter , true );
You can’t perform that action at this time.
0 commit comments