PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 1.5.3
Visualizer – Tables & Charts Manager with Built-in AI Generator v1.5.3
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / classes / Visualizer / Render / Sidebar / Linear.php

Linear.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 1.5.3, at classes/Visualizer/Render/Sidebar/Linear.php

280 lines 9.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // +----------------------------------------------------------------------+
4 // | Copyright 2013 Madpixels (email : visualizer@madpixels.net) |
5 // +----------------------------------------------------------------------+
6 // | This program is free software; you can redistribute it and/or modify |
7 // | it under the terms of the GNU General Public License, version 2, as |
8 // | published by the Free Software Foundation. |
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 General Public License for more details. |
14 // | |
15 // | You should have received a copy of the GNU General Public License |
16 // | along with this program; if not, write to the Free Software |
17 // | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
18 // | MA 02110-1301 USA |
19 // +----------------------------------------------------------------------+
20 // | Author: Eugene Manuilov <eugene@manuilov.org> |
21 // +----------------------------------------------------------------------+
22
23
24 /**
25 * Base class for sidebar settings of linear based charts.
26 *
27 * @category Visualizer
28 * @package Render
29 * @subpackage Sidebar
30 *
31 * @since 1.0.0
32 * @abstract
33 */
34 abstract class Visualizer_Render_Sidebar_Linear extends Visualizer_Render_Sidebar_Graph {
35
36 /**
37 * Determines whether we need to render curve type option or not.
38 *
39 * @since 1.0.0
40 *
41 * @access protected
42 * @var boolean
43 */
44 protected $_includeCurveTypes;
45
46 /**
47 * The array of available curve types.
48 *
49 * @since 1.0.0
50 *
51 * @access protected
52 * @var array
53 */
54 protected $_curveTypes;
55
56 /**
57 * Determines whether we need to render focus target option or not.
58 *
59 * @since 1.0.0
60 *
61 * @access protected
62 * @var boolean
63 */
64 protected $_includeFocusTarget;
65
66 /**
67 * Constructor.
68 *
69 * @since 1.0.0
70 *
71 * @access public
72 * @param array $data The data what has to be associated with this render.
73 */
74 public function __construct( $data = array() ) {
75 parent::__construct( $data );
76
77 $this->_includeCurveTypes = true;
78 $this->_includeFocusTarget = true;
79
80 $this->_curveTypes = array(
81 '' => '',
82 'none' => esc_html__( 'Straight line without curve', Visualizer_Plugin::NAME ),
83 'function' => esc_html__( 'The angles of the line will be smoothed', Visualizer_Plugin::NAME ),
84 );
85 }
86
87 /**
88 * Renders general settings block for horizontal axis settings.
89 *
90 * @since 1.4.0
91 *
92 * @access protected
93 */
94 protected function _renderHorizontalAxisGeneratSettings() {
95 parent::_renderHorizontalAxisGeneratSettings();
96 $this->_renderHorizontalAxisFormatField();
97 }
98
99 /**
100 * Renders general settings block for vertical axis settings.
101 *
102 * @since 1.4.0
103 *
104 * @access protected
105 */
106 protected function _renderVerticalAxisGeneralSettings() {
107 parent::_renderVerticalAxisGeneralSettings();
108 $this->_renderVerticalAxisFormatField();
109 }
110
111 /**
112 * Renders line settings items.
113 *
114 * @since 1.0.0
115 *
116 * @access protected
117 */
118 protected function _renderLineSettingsItems() {
119 echo '<div class="section-item">';
120 echo '<a class="more-info" href="javascript:;">[?]</a>';
121 echo '<b>', esc_html__( 'Line Width And Point Size', Visualizer_Plugin::NAME ), '</b>';
122
123 echo '<table class="section-table" cellspacing="0" cellpadding="0" border="0">';
124 echo '<tr>';
125 echo '<td class="section-table-column">';
126 echo '<input type="text" name="lineWidth" class="control-text" value="', esc_attr( $this->lineWidth ), '" placeholder="2">';
127 echo '</td>';
128 echo '<td class="section-table-column">';
129 echo '<input type="text" name="pointSize" class="control-text" value="', esc_attr( $this->pointSize ), '" placeholder="0">';
130 echo '</td>';
131 echo '</tr>';
132 echo '</table>';
133
134 echo '<p class="section-description">';
135 esc_html_e( 'Data line width and diameter of displayed points in pixels. Use zero to hide all lines or points.', Visualizer_Plugin::NAME );
136 echo '</p>';
137 echo '</div>';
138
139 if ( $this->_includeCurveTypes ) {
140 self::_renderSelectItem(
141 esc_html__( 'Curve Type', Visualizer_Plugin::NAME ),
142 'curveType',
143 $this->curveType,
144 $this->_curveTypes,
145 esc_html__( 'Determines whether the series has to be presented in the legend or not.', Visualizer_Plugin::NAME )
146 );
147 }
148
149 echo '<div class="section-delimiter"></div>';
150
151 if ( $this->_includeFocusTarget ) {
152 self::_renderSelectItem(
153 esc_html__( 'Focus Target', Visualizer_Plugin::NAME ),
154 'focusTarget',
155 $this->focusTarget,
156 array(
157 '' => '',
158 'datum' => esc_html__( 'Focus on a single data point.', Visualizer_Plugin::NAME ),
159 'category' => esc_html__( 'Focus on a grouping of all data points along the major axis.', Visualizer_Plugin::NAME ),
160 ),
161 esc_html__( 'The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click.', Visualizer_Plugin::NAME )
162 );
163 }
164
165 self::_renderSelectItem(
166 esc_html__( 'Selection Mode', Visualizer_Plugin::NAME ),
167 'selectionMode',
168 $this->selectionMode,
169 array(
170 '' => '',
171 'single' => esc_html__( 'Single data point', Visualizer_Plugin::NAME ),
172 'multiple' => esc_html__( 'Multiple data points', Visualizer_Plugin::NAME ),
173 ),
174 esc_html__( 'Determines how many data points an user can select on a chart.', Visualizer_Plugin::NAME )
175 );
176
177 self::_renderSelectItem(
178 esc_html__( 'Aggregation Target', Visualizer_Plugin::NAME ),
179 'aggregationTarget',
180 $this->aggregationTarget,
181 array(
182 '' => '',
183 'category' => esc_html__( 'Group selected data by x-value', Visualizer_Plugin::NAME ),
184 'series' => esc_html__( 'Group selected data by series', Visualizer_Plugin::NAME ),
185 'auto' => esc_html__( 'Group selected data by x-value if all selections have the same x-value, and by series otherwise', Visualizer_Plugin::NAME ),
186 'none' => esc_html__( 'Show only one tooltip per selection', Visualizer_Plugin::NAME ),
187 ),
188 esc_html__( 'Determines how multiple data selections are rolled up into tooltips. To make it working you need to set multiple selection mode and tooltip trigger to display it when an user selects an element.', Visualizer_Plugin::NAME )
189 );
190
191 echo '<div class="section-delimiter"></div>';
192
193 self::_renderTextItem(
194 esc_html__( 'Point Opacity', Visualizer_Plugin::NAME ),
195 'dataOpacity',
196 $this->dataOpacity,
197 esc_html__( 'The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent.', Visualizer_Plugin::NAME ),
198 '1.0'
199 );
200 }
201
202 /**
203 * Renders lines settings.
204 *
205 * @since 1.0.0
206 *
207 * @access protected
208 */
209 protected function _renderLineSettings() {
210 self::_renderGroupStart( esc_html__( 'Lines Settings', Visualizer_Plugin::NAME ) );
211 self::_renderSectionStart();
212 $this->_renderLineSettingsItems();
213 self::_renderSectionEnd();
214 self::_renderGroupEnd();
215 }
216
217 /**
218 * Renders concreate series settings.
219 *
220 * @since 1.0.0
221 *
222 * @access protected
223 * @param int $index The series index.
224 */
225 protected function _renderSeries( $index ) {
226 self::_renderSelectItem(
227 esc_html__( 'Visible In Legend', Visualizer_Plugin::NAME ),
228 'series[' . $index . '][visibleInLegend]',
229 isset( $this->series[$index]['visibleInLegend'] ) ? $this->series[$index]['visibleInLegend'] : '',
230 array(
231 '' => '',
232 '0' => esc_html__( 'No', Visualizer_Plugin::NAME ),
233 '1' => esc_html__( 'Yes', Visualizer_Plugin::NAME ),
234 ),
235 esc_html__( 'Determines whether the series has to be presented in the legend or not.', Visualizer_Plugin::NAME )
236 );
237
238 echo '<div class="section-item">';
239 echo '<a class="more-info" href="javascript:;">[?]</a>';
240 echo '<b>', esc_html__( 'Line Width And Point Size', Visualizer_Plugin::NAME ), '</b>';
241
242 echo '<table class="section-table" cellspacing="0" cellpadding="0" border="0">';
243 echo '<tr>';
244 echo '<td class="section-table-column">';
245 $line_width = isset( $this->series[$index]['lineWidth'] ) ? $this->series[$index]['lineWidth'] : '';
246 echo '<input type="text" name="series[', $index, '][lineWidth]" class="control-text" value="', esc_attr( $line_width ), '" placeholder="2">';
247 echo '</td>';
248 echo '<td class="section-table-column">';
249 $point_size = isset( $this->series[$index]['pointSize'] ) ? $this->series[$index]['pointSize'] : '';
250 echo '<input type="text" name="series[', $index, '][pointSize]" class="control-text" value="', esc_attr( $point_size ), '" placeholder="0">';
251 echo '</td>';
252 echo '</tr>';
253 echo '</table>';
254
255 echo '<p class="section-description">';
256 esc_html_e( 'Overrides the global line width and point size values for this series.', Visualizer_Plugin::NAME );
257 echo '</p>';
258 echo '</div>';
259
260 $this->_renderFormatField( $index );
261
262 if ( $this->_includeCurveTypes ) {
263 self::_renderSelectItem(
264 esc_html__( 'Curve Type', Visualizer_Plugin::NAME ),
265 'series[' . $index . '][curveType]',
266 isset( $this->series[$index]['curveType'] ) ? $this->series[$index]['curveType'] : '',
267 $this->_curveTypes,
268 esc_html__( 'Determines whether the series has to be presented in the legend or not.', Visualizer_Plugin::NAME )
269 );
270 }
271
272 self::_renderColorPickerItem(
273 esc_html__( 'Color', Visualizer_Plugin::NAME ),
274 'series[' . $index . '][color]',
275 isset( $this->series[$index]['color'] ) ? $this->series[$index]['color'] : null,
276 null
277 );
278 }
279
280 }