| @@ 5-150 (lines=146) @@ | ||
| 2 | ||
| 3 | namespace CMEN\GoogleChartsBundle\GoogleCharts\Options; |
|
| 4 | ||
| 5 | class AdvancedHAxis extends MediumHAxis |
|
| 6 | { |
|
| 7 | /** |
|
| 8 | * If false, will hide outermost labels rather than allow them to be cropped by the chart container. If true, |
|
| 9 | * will allow label cropping. |
|
| 10 | * |
|
| 11 | * @var bool |
|
| 12 | */ |
|
| 13 | protected $allowContainerBoundaryTextCufoff; |
|
| 14 | ||
| 15 | /** |
|
| 16 | * If true, draw the horizontal axis text at an angle, to help fit more text along the axis; if false, draw |
|
| 17 | * horizontal axis text upright. Default behavior is to slant text if it cannot all fit when drawn upright. |
|
| 18 | * Notice that this option is available only when the hAxis.textPosition is set to 'out' (which is the default). |
|
| 19 | * |
|
| 20 | * @var bool |
|
| 21 | */ |
|
| 22 | protected $slantedText; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * The angle of the horizontal axis text, if it's drawn slanted. Ignored if hAxis.slantedText is false, or is in |
|
| 26 | * auto mode, and the chart decided to draw the text horizontally. |
|
| 27 | * |
|
| 28 | * @var int |
|
| 29 | */ |
|
| 30 | protected $slantedTextAngle; |
|
| 31 | ||
| 32 | /** |
|
| 33 | * Maximum number of levels of horizontal axis text. If axis text labels become too crowded, the server might |
|
| 34 | * shift neighboring labels up or down in order to fit labels closer together. This value specifies the most |
|
| 35 | * number of levels to use; the server can use fewer levels, if labels can fit without overlapping. |
|
| 36 | * |
|
| 37 | * @var int |
|
| 38 | */ |
|
| 39 | protected $maxAlternation; |
|
| 40 | ||
| 41 | /** |
|
| 42 | * Maximum number of lines allowed for the text labels. Labels can span multiple lines if they are too long, |
|
| 43 | * and the nuber of lines is, by default, limited by the height of the available space. |
|
| 44 | * |
|
| 45 | * @var int |
|
| 46 | */ |
|
| 47 | protected $maxTextLines; |
|
| 48 | ||
| 49 | /** |
|
| 50 | * Minimum horizontal spacing, in pixels, allowed between two adjacent text labels. If the labels are spaced too |
|
| 51 | * densely, or they are too long, the spacing can drop below this threshold, and in this case one of the |
|
| 52 | * label-unclutter measures will be applied (e.g, truncating the lables or dropping some of them). |
|
| 53 | * |
|
| 54 | * @var int |
|
| 55 | */ |
|
| 56 | protected $minTextSpacing; |
|
| 57 | ||
| 58 | /** |
|
| 59 | * How many horizontal axis labels to show, where 1 means show every label, 2 means show every other label, |
|
| 60 | * and so on. Default is to try to show as many labels as possible without overlapping. |
|
| 61 | * |
|
| 62 | * @var int |
|
| 63 | */ |
|
| 64 | protected $showTextEvery; |
|
| 65 | ||
| 66 | /** |
|
| 67 | * @param int $showTextEvery |
|
| 68 | * |
|
| 69 | * @return $this |
|
| 70 | */ |
|
| 71 | public function setShowTextEvery($showTextEvery) |
|
| 72 | { |
|
| 73 | $this->showTextEvery = $showTextEvery; |
|
| 74 | ||
| 75 | return $this; |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * @param bool $allowContainerBoundaryTextCufoff |
|
| 80 | * |
|
| 81 | * @return $this |
|
| 82 | */ |
|
| 83 | public function setAllowContainerBoundaryTextCufoff($allowContainerBoundaryTextCufoff) |
|
| 84 | { |
|
| 85 | $this->allowContainerBoundaryTextCufoff = $allowContainerBoundaryTextCufoff; |
|
| 86 | ||
| 87 | return $this; |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * @param bool $slantedText |
|
| 92 | * |
|
| 93 | * @return $this |
|
| 94 | */ |
|
| 95 | public function setSlantedText($slantedText) |
|
| 96 | { |
|
| 97 | $this->slantedText = $slantedText; |
|
| 98 | ||
| 99 | return $this; |
|
| 100 | } |
|
| 101 | ||
| 102 | /** |
|
| 103 | * @param int $slantedTextAngle |
|
| 104 | * |
|
| 105 | * @return $this |
|
| 106 | */ |
|
| 107 | public function setSlantedTextAngle($slantedTextAngle) |
|
| 108 | { |
|
| 109 | $this->slantedTextAngle = $slantedTextAngle; |
|
| 110 | ||
| 111 | return $this; |
|
| 112 | } |
|
| 113 | ||
| 114 | /** |
|
| 115 | * @param int $maxAlternation |
|
| 116 | * |
|
| 117 | * @return $this |
|
| 118 | */ |
|
| 119 | public function setMaxAlternation($maxAlternation) |
|
| 120 | { |
|
| 121 | $this->maxAlternation = $maxAlternation; |
|
| 122 | ||
| 123 | return $this; |
|
| 124 | } |
|
| 125 | ||
| 126 | /** |
|
| 127 | * @param int $maxTextLines |
|
| 128 | * |
|
| 129 | * @return $this |
|
| 130 | */ |
|
| 131 | public function setMaxTextLines($maxTextLines) |
|
| 132 | { |
|
| 133 | $this->maxTextLines = $maxTextLines; |
|
| 134 | ||
| 135 | return $this; |
|
| 136 | } |
|
| 137 | ||
| 138 | /** |
|
| 139 | * @param int $minTextSpacing |
|
| 140 | * |
|
| 141 | * @return $this |
|
| 142 | */ |
|
| 143 | public function setMinTextSpacing($minTextSpacing) |
|
| 144 | { |
|
| 145 | $this->minTextSpacing = $minTextSpacing; |
|
| 146 | ||
| 147 | return $this; |
|
| 148 | } |
|
| 149 | } |
|
| 150 | ||
| @@ 8-153 (lines=146) @@ | ||
| 5 | /** |
|
| 6 | * @author Christophe Meneses |
|
| 7 | */ |
|
| 8 | class HAxis extends \CMEN\GoogleChartsBundle\GoogleCharts\Options\HAxis |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * If false, will hide outermost labels rather than allow them to be cropped by the chart container. If true, |
|
| 12 | * will allow label cropping. |
|
| 13 | * |
|
| 14 | * @var bool |
|
| 15 | */ |
|
| 16 | protected $allowContainerBoundaryTextCufoff; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * If true, draw the horizontal axis text at an angle, to help fit more text along the axis; if false, draw |
|
| 20 | * horizontal axis text upright. Default behavior is to slant text if it cannot all fit when drawn upright. |
|
| 21 | * Notice that this option is available only when the hAxis.textPosition is set to 'out' (which is the default). |
|
| 22 | * |
|
| 23 | * @var bool |
|
| 24 | */ |
|
| 25 | protected $slantedText; |
|
| 26 | ||
| 27 | /** |
|
| 28 | * The angle of the horizontal axis text, if it's drawn slanted. Ignored if hAxis.slantedText is false, or is in |
|
| 29 | * auto mode, and the chart decided to draw the text horizontally. |
|
| 30 | * |
|
| 31 | * @var int |
|
| 32 | */ |
|
| 33 | protected $slantedTextAngle; |
|
| 34 | ||
| 35 | /** |
|
| 36 | * Maximum number of levels of horizontal axis text. If axis text labels become too crowded, the server might |
|
| 37 | * shift neighboring labels up or down in order to fit labels closer together. This value specifies the most |
|
| 38 | * number of levels to use; the server can use fewer levels, if labels can fit without overlapping. |
|
| 39 | * |
|
| 40 | * @var int |
|
| 41 | */ |
|
| 42 | protected $maxAlternation; |
|
| 43 | ||
| 44 | /** |
|
| 45 | * Maximum number of lines allowed for the text labels. Labels can span multiple lines if they are too long, |
|
| 46 | * and the nuber of lines is, by default, limited by the height of the available space. |
|
| 47 | * |
|
| 48 | * @var int |
|
| 49 | */ |
|
| 50 | protected $maxTextLines; |
|
| 51 | ||
| 52 | /** |
|
| 53 | * Minimum horizontal spacing, in pixels, allowed between two adjacent text labels. If the labels are spaced too |
|
| 54 | * densely, or they are too long, the spacing can drop below this threshold, and in this case one of the |
|
| 55 | * label-unclutter measures will be applied (e.g, truncating the lables or dropping some of them). |
|
| 56 | * |
|
| 57 | * @var int |
|
| 58 | */ |
|
| 59 | protected $minTextSpacing; |
|
| 60 | ||
| 61 | /** |
|
| 62 | * How many horizontal axis labels to show, where 1 means show every label, 2 means show every other label, |
|
| 63 | * and so on. Default is to try to show as many labels as possible without overlapping. |
|
| 64 | * |
|
| 65 | * @var int |
|
| 66 | */ |
|
| 67 | protected $showTextEvery; |
|
| 68 | ||
| 69 | /** |
|
| 70 | * @param int $showTextEvery |
|
| 71 | * |
|
| 72 | * @return $this |
|
| 73 | */ |
|
| 74 | public function setShowTextEvery($showTextEvery) |
|
| 75 | { |
|
| 76 | $this->showTextEvery = $showTextEvery; |
|
| 77 | ||
| 78 | return $this; |
|
| 79 | } |
|
| 80 | ||
| 81 | /** |
|
| 82 | * @param bool $allowContainerBoundaryTextCufoff |
|
| 83 | * |
|
| 84 | * @return $this |
|
| 85 | */ |
|
| 86 | public function setAllowContainerBoundaryTextCufoff($allowContainerBoundaryTextCufoff) |
|
| 87 | { |
|
| 88 | $this->allowContainerBoundaryTextCufoff = $allowContainerBoundaryTextCufoff; |
|
| 89 | ||
| 90 | return $this; |
|
| 91 | } |
|
| 92 | ||
| 93 | /** |
|
| 94 | * @param bool $slantedText |
|
| 95 | * |
|
| 96 | * @return $this |
|
| 97 | */ |
|
| 98 | public function setSlantedText($slantedText) |
|
| 99 | { |
|
| 100 | $this->slantedText = $slantedText; |
|
| 101 | ||
| 102 | return $this; |
|
| 103 | } |
|
| 104 | ||
| 105 | /** |
|
| 106 | * @param int $slantedTextAngle |
|
| 107 | * |
|
| 108 | * @return $this |
|
| 109 | */ |
|
| 110 | public function setSlantedTextAngle($slantedTextAngle) |
|
| 111 | { |
|
| 112 | $this->slantedTextAngle = $slantedTextAngle; |
|
| 113 | ||
| 114 | return $this; |
|
| 115 | } |
|
| 116 | ||
| 117 | /** |
|
| 118 | * @param int $maxAlternation |
|
| 119 | * |
|
| 120 | * @return $this |
|
| 121 | */ |
|
| 122 | public function setMaxAlternation($maxAlternation) |
|
| 123 | { |
|
| 124 | $this->maxAlternation = $maxAlternation; |
|
| 125 | ||
| 126 | return $this; |
|
| 127 | } |
|
| 128 | ||
| 129 | /** |
|
| 130 | * @param int $maxTextLines |
|
| 131 | * |
|
| 132 | * @return $this |
|
| 133 | */ |
|
| 134 | public function setMaxTextLines($maxTextLines) |
|
| 135 | { |
|
| 136 | $this->maxTextLines = $maxTextLines; |
|
| 137 | ||
| 138 | return $this; |
|
| 139 | } |
|
| 140 | ||
| 141 | /** |
|
| 142 | * @param int $minTextSpacing |
|
| 143 | * |
|
| 144 | * @return $this |
|
| 145 | */ |
|
| 146 | public function setMinTextSpacing($minTextSpacing) |
|
| 147 | { |
|
| 148 | $this->minTextSpacing = $minTextSpacing; |
|
| 149 | ||
| 150 | return $this; |
|
| 151 | } |
|
| 152 | } |
|
| 153 | ||