PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 1.4.2.2
Visualizer – Tables & Charts Manager with Built-in AI Generator v1.4.2.2
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
← All changes | classes/Visualizer/Render/Sidebar/Linear.php +86 -70 3.10.01.4.2.2 View file →
@@ -18,8 +18,10 @@
18 18 // | MA 02110-1301 USA |
19 19 // +----------------------------------------------------------------------+
20 20 // | Author: Eugene Manuilov <eugene@manuilov.org> |
21 21 // +----------------------------------------------------------------------+
22 +
23 +
22 24 /**
23 25 * Base class for sidebar settings of linear based charts.
24 26 *
25 27 * @category Visualizer
@@ -76,10 +78,10 @@
76 78 $this->_includeFocusTarget = true;
77 79
78 80 $this->_curveTypes = array(
79 81 '' => '',
80 - 'none' => esc_html__( 'Straight line without curve', 'visualizer' ),
81 - 'function' => esc_html__( 'The angles of the line will be smoothed', 'visualizer' ),
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 ),
82 84 );
83 85 }
84 86
85 87 /**
@@ -88,19 +90,30 @@
88 90 * @since 1.4.0
89 91 *
90 92 * @access protected
91 93 */
92 - protected function _renderHorizontalAxisGeneralSettings() {
93 - parent::_renderHorizontalAxisGeneralSettings();
94 + protected function _renderHorizontalAxisGeneratSettings() {
95 + parent::_renderHorizontalAxisGeneratSettings();
94 96
95 - self::_renderColorPickerItem(
96 - esc_html__( 'Axis Text Color', 'visualizer' ),
97 - 'hAxis[textStyle]',
98 - isset( $this->hAxis['textStyle'] ) ? $this->hAxis['textStyle'] : null,
99 - '#000'
97 + self::_renderTextItem(
98 + esc_html__( 'Number Format', Visualizer_Plugin::NAME ),
99 + 'hAxis[format]',
100 + isset( $this->hAxis['format'] ) ? $this->hAxis['format'] : '',
101 + sprintf(
102 + '%s<br><br>%s<br><br>%s',
103 + esc_html__( 'Enter custom format pattern to apply to horizontal axis labels.', Visualizer_Plugin::NAME ),
104 + sprintf(
105 + esc_html__( 'For number axis labels, this is a subset of the decimal formatting %sICU pattern set%s. For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.', Visualizer_Plugin::NAME ),
106 + '<a href="http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details" target="_blank">',
107 + '</a>'
108 + ),
109 + sprintf(
110 + esc_html__( 'For date axis labels, this is a subset of the date formatting %sICU date and time format%s.', Visualizer_Plugin::NAME ),
111 + '<a href="http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax" target="_blank">',
112 + '</a>'
113 + )
114 + )
100 115 );
101 -
102 - $this->_renderHorizontalAxisFormatField();
103 116 }
104 117
105 118 /**
106 119 * Renders general settings block for vertical axis settings.
@@ -111,16 +124,22 @@
111 124 */
112 125 protected function _renderVerticalAxisGeneralSettings() {
113 126 parent::_renderVerticalAxisGeneralSettings();
114 127
115 - self::_renderColorPickerItem(
116 - esc_html__( 'Axis Text Color', 'visualizer' ),
117 - 'vAxis[textStyle]',
118 - isset( $this->vAxis['textStyle'] ) ? $this->vAxis['textStyle'] : null,
119 - '#000'
128 + self::_renderTextItem(
129 + esc_html__( 'Number Format', Visualizer_Plugin::NAME ),
130 + 'vAxis[format]',
131 + isset( $this->vAxis['format'] ) ? $this->vAxis['format'] : '',
132 + sprintf(
133 + '%s<br><br>%s',
134 + esc_html__( 'Enter custom format pattern to apply to vertical axis labels.', Visualizer_Plugin::NAME ),
135 + sprintf(
136 + esc_html__( 'For number axis labels, this is a subset of the decimal formatting %sICU pattern set%s. For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.', Visualizer_Plugin::NAME ),
137 + '<a href="http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details" target="_blank">',
138 + '</a>'
139 + )
140 + )
120 141 );
121 -
122 - $this->_renderVerticalAxisFormatField();
123 142 }
124 143
125 144 /**
126 145 * Renders line settings items.
@@ -129,87 +148,87 @@
129 148 *
130 149 * @access protected
131 150 */
132 151 protected function _renderLineSettingsItems() {
133 - echo '<div class="viz-section-item">';
152 + echo '<div class="section-item">';
134 153 echo '<a class="more-info" href="javascript:;">[?]</a>';
135 - echo '<b>', esc_html__( 'Line Width And Point Size', 'visualizer' ), '</b>';
154 + echo '<b>', esc_html__( 'Line Width And Point Size', Visualizer_Plugin::NAME ), '</b>';
136 155
137 - echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">';
156 + echo '<table class="section-table" cellspacing="0" cellpadding="0" border="0">';
138 157 echo '<tr>';
139 - echo '<td class="viz-section-table-column">';
158 + echo '<td class="section-table-column">';
140 159 echo '<input type="text" name="lineWidth" class="control-text" value="', esc_attr( $this->lineWidth ), '" placeholder="2">';
141 160 echo '</td>';
142 - echo '<td class="viz-section-table-column">';
161 + echo '<td class="section-table-column">';
143 162 echo '<input type="text" name="pointSize" class="control-text" value="', esc_attr( $this->pointSize ), '" placeholder="0">';
144 163 echo '</td>';
145 164 echo '</tr>';
146 165 echo '</table>';
147 166
148 - echo '<p class="viz-section-description">';
149 - esc_html_e( 'Data line width and diameter of displayed points in pixels. Use zero to hide all lines or points.', 'visualizer' );
167 + echo '<p class="section-description">';
168 + esc_html_e( 'Data line width and diameter of displayed points in pixels. Use zero to hide all lines or points.', Visualizer_Plugin::NAME );
150 169 echo '</p>';
151 170 echo '</div>';
152 171
153 172 if ( $this->_includeCurveTypes ) {
154 173 self::_renderSelectItem(
155 - esc_html__( 'Curve Type', 'visualizer' ),
174 + esc_html__( 'Curve Type', Visualizer_Plugin::NAME ),
156 175 'curveType',
157 176 $this->curveType,
158 177 $this->_curveTypes,
159 - esc_html__( 'Determines whether the series has to be presented in the legend or not.', 'visualizer' )
178 + esc_html__( 'Determines whether the series has to be presented in the legend or not.', Visualizer_Plugin::NAME )
160 179 );
161 180 }
162 181
163 - echo '<div class="viz-section-delimiter"></div>';
182 + echo '<div class="section-delimiter"></div>';
164 183
165 184 if ( $this->_includeFocusTarget ) {
166 185 self::_renderSelectItem(
167 - esc_html__( 'Focus Target', 'visualizer' ),
186 + esc_html__( 'Focus Target', Visualizer_Plugin::NAME ),
168 187 'focusTarget',
169 188 $this->focusTarget,
170 189 array(
171 190 '' => '',
172 - 'datum' => esc_html__( 'Focus on a single data point.', 'visualizer' ),
173 - 'category' => esc_html__( 'Focus on a grouping of all data points along the major axis.', 'visualizer' ),
191 + 'datum' => esc_html__( 'Focus on a single data point.', Visualizer_Plugin::NAME ),
192 + 'category' => esc_html__( 'Focus on a grouping of all data points along the major axis.', Visualizer_Plugin::NAME ),
174 193 ),
175 - esc_html__( 'The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click.', 'visualizer' )
194 + 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 )
176 195 );
177 196 }
178 197
179 198 self::_renderSelectItem(
180 - esc_html__( 'Selection Mode', 'visualizer' ),
199 + esc_html__( 'Selection Mode', Visualizer_Plugin::NAME ),
181 200 'selectionMode',
182 201 $this->selectionMode,
183 202 array(
184 203 '' => '',
185 - 'single' => esc_html__( 'Single data point', 'visualizer' ),
186 - 'multiple' => esc_html__( 'Multiple data points', 'visualizer' ),
204 + 'single' => esc_html__( 'Single data point', Visualizer_Plugin::NAME ),
205 + 'multiple' => esc_html__( 'Multiple data points', Visualizer_Plugin::NAME ),
187 206 ),
188 - esc_html__( 'Determines how many data points an user can select on a chart.', 'visualizer' )
207 + esc_html__( 'Determines how many data points an user can select on a chart.', Visualizer_Plugin::NAME )
189 208 );
190 209
191 210 self::_renderSelectItem(
192 - esc_html__( 'Aggregation Target', 'visualizer' ),
211 + esc_html__( 'Aggregation Target', Visualizer_Plugin::NAME ),
193 212 'aggregationTarget',
194 213 $this->aggregationTarget,
195 214 array(
196 215 '' => '',
197 - 'category' => esc_html__( 'Group selected data by x-value', 'visualizer' ),
198 - 'series' => esc_html__( 'Group selected data by series', 'visualizer' ),
199 - 'auto' => esc_html__( 'Group selected data by x-value if all selections have the same x-value, and by series otherwise', 'visualizer' ),
200 - 'none' => esc_html__( 'Show only one tooltip per selection', 'visualizer' ),
216 + 'category' => esc_html__( 'Group selected data by x-value', Visualizer_Plugin::NAME ),
217 + 'series' => esc_html__( 'Group selected data by series', Visualizer_Plugin::NAME ),
218 + 'auto' => esc_html__( 'Group selected data by x-value if all selections have the same x-value, and by series otherwise', Visualizer_Plugin::NAME ),
219 + 'none' => esc_html__( 'Show only one tooltip per selection', Visualizer_Plugin::NAME ),
201 220 ),
202 - 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' )
221 + 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 )
203 222 );
204 223
205 - echo '<div class="viz-section-delimiter"></div>';
224 + echo '<div class="section-delimiter"></div>';
206 225
207 226 self::_renderTextItem(
208 - esc_html__( 'Point Opacity', 'visualizer' ),
227 + esc_html__( 'Point Opacity', Visualizer_Plugin::NAME ),
209 228 'dataOpacity',
210 229 $this->dataOpacity,
211 - esc_html__( 'The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent.', 'visualizer' ),
230 + esc_html__( 'The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent.', Visualizer_Plugin::NAME ),
212 231 '1.0'
213 232 );
214 233 }
215 234
@@ -220,9 +239,9 @@
220 239 *
221 240 * @access protected
222 241 */
223 242 protected function _renderLineSettings() {
224 - self::_renderGroupStart( esc_html__( 'Lines Settings', 'visualizer' ) );
243 + self::_renderGroupStart( esc_html__( 'Lines Settings', Visualizer_Plugin::NAME ) );
225 244 self::_renderSectionStart();
226 245 $this->_renderLineSettingsItems();
227 246 self::_renderSectionEnd();
228 247 self::_renderGroupEnd();
@@ -237,38 +256,38 @@
237 256 * @param int $index The series index.
238 257 */
239 258 protected function _renderSeries( $index ) {
240 259 self::_renderSelectItem(
241 - esc_html__( 'Visible In Legend', 'visualizer' ),
260 + esc_html__( 'Visible In Legend', Visualizer_Plugin::NAME ),
242 261 'series[' . $index . '][visibleInLegend]',
243 - isset( $this->series[ $index ]['visibleInLegend'] ) ? $this->series[ $index ]['visibleInLegend'] : '',
262 + isset( $this->series[$index]['visibleInLegend'] ) ? $this->series[$index]['visibleInLegend'] : '',
244 263 array(
245 264 '' => '',
246 - '0' => esc_html__( 'No', 'visualizer' ),
247 - '1' => esc_html__( 'Yes', 'visualizer' ),
265 + '0' => esc_html__( 'No', Visualizer_Plugin::NAME ),
266 + '1' => esc_html__( 'Yes', Visualizer_Plugin::NAME ),
248 267 ),
249 - esc_html__( 'Determines whether the series has to be presented in the legend or not.', 'visualizer' )
268 + esc_html__( 'Determines whether the series has to be presented in the legend or not.', Visualizer_Plugin::NAME )
250 269 );
251 270
252 - echo '<div class="viz-section-item">';
271 + echo '<div class="section-item">';
253 272 echo '<a class="more-info" href="javascript:;">[?]</a>';
254 - echo '<b>', esc_html__( 'Line Width And Point Size', 'visualizer' ), '</b>';
273 + echo '<b>', esc_html__( 'Line Width And Point Size', Visualizer_Plugin::NAME ), '</b>';
255 274
256 - echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">';
275 + echo '<table class="section-table" cellspacing="0" cellpadding="0" border="0">';
257 276 echo '<tr>';
258 - echo '<td class="viz-section-table-column">';
259 - $line_width = isset( $this->series[ $index ]['lineWidth'] ) ? $this->series[ $index ]['lineWidth'] : '';
260 - echo '<input type="text" name="series[', $index, '][lineWidth]" class="control-text series-linewidth" value="', esc_attr( $line_width ), '" placeholder="2">';
277 + echo '<td class="section-table-column">';
278 + $line_width = isset( $this->series[$index]['lineWidth'] ) ? $this->series[$index]['lineWidth'] : '';
279 + echo '<input type="text" name="series[', $index, '][lineWidth]" class="control-text" value="', esc_attr( $line_width ), '" placeholder="2">';
261 280 echo '</td>';
262 - echo '<td class="viz-section-table-column">';
263 - $point_size = isset( $this->series[ $index ]['pointSize'] ) ? $this->series[ $index ]['pointSize'] : '';
281 + echo '<td class="section-table-column">';
282 + $point_size = isset( $this->series[$index]['pointSize'] ) ? $this->series[$index]['pointSize'] : '';
264 283 echo '<input type="text" name="series[', $index, '][pointSize]" class="control-text" value="', esc_attr( $point_size ), '" placeholder="0">';
265 284 echo '</td>';
266 285 echo '</tr>';
267 286 echo '</table>';
268 287
269 - echo '<p class="viz-section-description">';
270 - esc_html_e( 'Overrides the global line width and point size values for this series.', 'visualizer' );
288 + echo '<p class="section-description">';
289 + esc_html_e( 'Overrides the global line width and point size values for this series.', Visualizer_Plugin::NAME );
271 290 echo '</p>';
272 291 echo '</div>';
273 292
274 293 $this->_renderFormatField( $index );
@@ -274,24 +293,21 @@
274 293 $this->_renderFormatField( $index );
275 294
276 295 if ( $this->_includeCurveTypes ) {
277 296 self::_renderSelectItem(
278 - esc_html__( 'Curve Type', 'visualizer' ),
297 + esc_html__( 'Curve Type', Visualizer_Plugin::NAME ),
279 298 'series[' . $index . '][curveType]',
280 - isset( $this->series[ $index ]['curveType'] ) ? $this->series[ $index ]['curveType'] : '',
299 + isset( $this->series[$index]['curveType'] ) ? $this->series[$index]['curveType'] : '',
281 300 $this->_curveTypes,
282 - esc_html__( 'Determines whether the series has to be presented in the legend or not.', 'visualizer' )
301 + esc_html__( 'Determines whether the series has to be presented in the legend or not.', Visualizer_Plugin::NAME )
283 302 );
284 303 }
285 304
286 305 self::_renderColorPickerItem(
287 - esc_html__( 'Color', 'visualizer' ),
306 + esc_html__( 'Color', Visualizer_Plugin::NAME ),
288 307 'series[' . $index . '][color]',
289 - isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null,
308 + isset( $this->series[$index]['color'] ) ? $this->series[$index]['color'] : null,
290 309 null
291 310 );
292 -
293 - $this->_renderRoleField( $index );
294 -
295 311 }
296 312
297 -}
313 +}