PluginProbe
E2Pdf – Export Pdf Tool for WordPress / 1.32.48
E2Pdf – Export Pdf Tool for WordPress v1.32.48
1.32.49 1.32.48 1.32.43 1.32.40 1.32.34 1.32.32 1.32.31 1.32.26 1.32.22 1.32.23 1.32.18 1.32.17 1.32.15 trunk 1.00.00 1.00.13 1.01.01 1.02.02 1.03.07 1.04.07 1.05.03 1.06.02 1.07.11 1.08.00 1.08.06 All 72 releases
e2pdf / vendors / svggraph / StackedGrouped3DGraphTrait.php

StackedGrouped3DGraphTrait.php in E2Pdf – Export Pdf Tool for WordPress 1.32.48, at vendors/svggraph/StackedGrouped3DGraphTrait.php

59 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Copyright (C) 2019-2022 Graham Breach
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 /**
19 * For more information, please contact <graham@goat1000.com>
20 */
21
22 namespace Goat1000\SVGGraph;
23
24 trait StackedGrouped3DGraphTrait {
25
26 use StackedGroupedBarTrait;
27
28 /**
29 * Override AdjustAxes to change depth
30 */
31 protected function adjustAxes(&$x_len, &$y_len)
32 {
33 /**
34 * The depth is roughly 1/$num - but it must also take into account the
35 * bar and group spacing, which is where things get messy
36 */
37 $ends = $this->getAxisEnds();
38 $num = $ends['k_max'][0] - $ends['k_min'][0] + 1;
39
40 $block = $x_len / $num;
41 $group = count($this->groups);
42 $a = $this->getOption('bar_space');
43 $b = $this->getOption('group_space');
44 $c = (($block) - $a - ($group - 1) * $b) / $group;
45 $d = ($a + $c) / $block;
46 $this->depth = $d;
47 return parent::adjustAxes($x_len, $y_len);
48 }
49
50 /**
51 * Sets whether a bar is visible or not
52 */
53 protected function setBarVisibility($dataset, DataItem $item, $top, $override = null)
54 {
55 // alias set in StackedBar3DGraph or StackedCylinderGraph
56 $this->traitSetBarVis($dataset, $item, $top, $top || $item->value != 0);
57 }
58 }
59