PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.11.14
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.11.14
4.0.8 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 All 149 releases
← All changes | classes/Visualizer/Render/Sidebar/Graph.php +92 -34 3.0.83.11.14 View file →
@@ -28,9 +28,9 @@
28 28 *
29 29 * @since 1.0.0
30 30 * @abstract
31 31 */
32 -abstract class Visualizer_Render_Sidebar_Graph extends Visualizer_Render_Sidebar {
32 +abstract class Visualizer_Render_Sidebar_Graph extends Visualizer_Render_Sidebar_Google {
33 33
34 34 /**
35 35 * Determines whether we need to render vertical gridlines options or not.
36 36 *
@@ -121,8 +121,23 @@
121 121 $this->axisTitlesPosition,
122 122 $this->_positions,
123 123 esc_html__( 'Determines where to place the axis titles, compared to the chart area.', 'visualizer' )
124 124 );
125 +
126 + echo '<div class="viz-section-delimiter"></div>';
127 +
128 + self::_renderTextAreaItem(
129 + esc_html__( 'Chart Description', 'visualizer' ),
130 + 'description',
131 + $this->description,
132 + sprintf(
133 + // translators: %1$s - HTML link tag, %2$s - HTML closing link tag.
134 + esc_html__( 'Description to display in the structured data schema as explained %1$shere%2$s', 'visualizer' ),
135 + '<a href="https://developers.google.com/search/docs/data-types/dataset#dataset" target="_blank">',
136 + '</a>'
137 + )
138 + );
139 +
125 140 }
126 141
127 142 /**
128 143 * Renders general settings block for horizontal axis settings.
@@ -139,11 +154,36 @@
139 154 esc_html__( 'The title of the horizontal axis.', 'visualizer' )
140 155 );
141 156
142 157 self::_renderSelectItem(
158 + esc_html__( 'Slanted Text', 'visualizer' ),
159 + 'hAxis[slantedText]',
160 + isset( $this->hAxis['slantedText'] ) ? $this->hAxis['slantedText'] : false,
161 + array(
162 + false => 'False',
163 + true => 'True',
164 + ),
165 + '',
166 + false
167 + );
168 +
169 + self::_renderTextItem(
170 + esc_html__( 'Slanted Text Angle', 'visualizer' ),
171 + 'hAxis[slantedTextAngle]',
172 + isset( $this->hAxis['slantedTextAngle'] ) ? $this->hAxis['slantedTextAngle'] : 45,
173 + '',
174 + 45,
175 + 'number',
176 + array(
177 + 'min' => 1,
178 + 'step' => 15,
179 + )
180 + );
181 +
182 + self::_renderSelectItem(
143 183 esc_html__( 'Text Position', 'visualizer' ),
144 - 'vAxis[textPosition]',
145 - isset( $this->vAxis['textPosition'] ) ? $this->vAxis['textPosition'] : '',
184 + 'hAxis[textPosition]',
185 + isset( $this->hAxis['textPosition'] ) ? $this->hAxis['textPosition'] : '',
146 186 $this->_positions,
147 187 esc_html__( 'Position of the horizontal axis text, relative to the chart area.', 'visualizer' )
148 188 );
149 189
@@ -178,23 +218,24 @@
178 218 self::_renderGroupStart( esc_html__( 'Horizontal Axis Settings', 'visualizer' ) );
179 219 self::_renderSectionStart( esc_html__( 'General Settings', 'visualizer' ), false );
180 220 $this->_renderHorizontalAxisGeneralSettings();
181 221 self::_renderSectionEnd();
182 -
183 222 if ( $this->_horizontalGridLines ) {
184 223 self::_renderSectionStart( esc_html__( 'Grid Lines', 'visualizer' ), false );
185 224 self::_renderTextItem(
186 225 esc_html__( 'Count', 'visualizer' ),
187 - 'vAxis[gridlines][count]',
188 - isset( $this->vAxis['gridlines']['count'] ) ? $this->vAxis['gridlines']['count'] : '',
189 - esc_html__( 'The number of horizontal gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically compute the number of gridlines.', 'visualizer' ),
190 - 5
226 + 'hAxis[gridlines][count]',
227 + isset( $this->hAxis['gridlines']['count'] ) ? $this->hAxis['gridlines']['count'] : '',
228 + esc_html__( 'The approximate number of horizontal gridlines inside the chart area. You can specify a value of -1 to automatically compute the number of gridlines, 0 or 1 to draw no gridlines, or 2 or more to only draw gridline. Any number greater than 2 will be used to compute the minSpacing between gridlines.', 'visualizer' ),
229 + 5,
230 + 'number',
231 + array( 'min' => -1, 'max' => 1000, 'step' => 1 )
191 232 );
192 233
193 234 self::_renderColorPickerItem(
194 235 esc_html__( 'Color', 'visualizer' ),
195 - 'vAxis[gridlines][color]',
196 - isset( $this->vAxis['gridlines']['color'] ) ? $this->vAxis['gridlines']['color'] : null,
236 + 'hAxis[gridlines][color]',
237 + isset( $this->hAxis['gridlines']['color'] ) ? $this->hAxis['gridlines']['color'] : null,
197 238 '#ccc'
198 239 );
199 240 self::_renderSectionEnd();
200 241
@@ -200,24 +241,26 @@
200 241
201 242 self::_renderSectionStart( esc_html__( 'Minor Grid Lines', 'visualizer' ), false );
202 243 self::_renderTextItem(
203 244 esc_html__( 'Count', 'visualizer' ),
204 - 'vAxis[minorGridlines][count]',
205 - isset( $this->vAxis['minorGridlines']['count'] ) ? $this->vAxis['minorGridlines']['count'] : '',
206 - esc_html__( 'The number of horizontal minor gridlines between two regular gridlines.', 'visualizer' ),
207 - 0
245 + 'hAxis[minorGridlines][count]',
246 + isset( $this->hAxis['minorGridlines']['count'] ) ? $this->hAxis['minorGridlines']['count'] : '',
247 + esc_html__( 'Specify 0 to disable the minor gridlines.', 'visualizer' ),
248 + 0,
249 + 'number',
250 + array( 'min' => 0, 'step' => 1 )
208 251 );
209 252
210 253 self::_renderColorPickerItem(
211 254 esc_html__( 'Color', 'visualizer' ),
212 - 'vAxis[minorGridlines][color]',
213 - isset( $this->vAxis['minorGridlines']['color'] ) ? $this->vAxis['minorGridlines']['color'] : null,
255 + 'hAxis[minorGridlines][color]',
256 + isset( $this->hAxis['minorGridlines']['color'] ) ? $this->hAxis['minorGridlines']['color'] : null,
214 257 null
215 258 );
216 259 self::_renderSectionEnd();
217 260 }
218 261
219 - if ( $this->_verticalGridLines ) {
262 + if ( $this->_horizontalGridLines ) {
220 263 self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false );
221 264 self::_renderTextItem(
222 265 esc_html__( 'Maximum Value', 'visualizer' ),
223 266 'hAxis[viewWindow][max]',
@@ -252,10 +295,10 @@
252 295 );
253 296
254 297 self::_renderSelectItem(
255 298 esc_html__( 'Text Position', 'visualizer' ),
256 - 'hAxis[textPosition]',
257 - isset( $this->hAxis['textPosition'] ) ? $this->hAxis['textPosition'] : '',
299 + 'vAxis[textPosition]',
300 + isset( $this->vAxis['textPosition'] ) ? $this->vAxis['textPosition'] : '',
258 301 $this->_positions,
259 302 esc_html__( 'Position of the vertical axis text, relative to the chart area.', 'visualizer' )
260 303 );
261 304
@@ -295,18 +338,20 @@
295 338 if ( $this->_verticalGridLines ) {
296 339 self::_renderSectionStart( esc_html__( 'Grid Lines', 'visualizer' ), false );
297 340 self::_renderTextItem(
298 341 esc_html__( 'Count', 'visualizer' ),
299 - 'hAxis[gridlines][count]',
300 - isset( $this->hAxis['gridlines']['count'] ) ? $this->hAxis['gridlines']['count'] : '',
301 - esc_html__( 'The number of vertical gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically compute the number of gridlines.', 'visualizer' ),
302 - 5
342 + 'vAxis[gridlines][count]',
343 + isset( $this->vAxis['gridlines']['count'] ) ? $this->vAxis['gridlines']['count'] : '',
344 + esc_html__( 'The approximate number of vertical gridlines inside the chart area. You can specify a value of -1 to automatically compute the number of gridlines, 0 or 1 to draw no gridlines, or 2 or more to only draw gridline. Any number greater than 2 will be used to compute the minSpacing between gridlines.', 'visualizer' ),
345 + 5,
346 + 'number',
347 + array( 'min' => -1, 'max' => 1000, 'step' => 1 )
303 348 );
304 349
305 350 self::_renderColorPickerItem(
306 351 esc_html__( 'Color', 'visualizer' ),
307 - 'hAxis[gridlines][color]',
308 - isset( $this->hAxis['gridlines']['color'] ) ? $this->hAxis['gridlines']['color'] : null,
352 + 'vAxis[gridlines][color]',
353 + isset( $this->vAxis['gridlines']['color'] ) ? $this->vAxis['gridlines']['color'] : null,
309 354 '#ccc'
310 355 );
311 356 self::_renderSectionEnd();
312 357
@@ -312,24 +357,26 @@
312 357
313 358 self::_renderSectionStart( esc_html__( 'Minor Grid Lines', 'visualizer' ), false );
314 359 self::_renderTextItem(
315 360 esc_html__( 'Count', 'visualizer' ),
316 - 'hAxis[minorGridlines][count]',
317 - isset( $this->hAxis['minorGridlines']['count'] ) ? $this->hAxis['minorGridlines']['count'] : '',
318 - esc_html__( 'The number of vertical minor gridlines between two regular gridlines.', 'visualizer' ),
319 - 0
361 + 'vAxis[minorGridlines][count]',
362 + isset( $this->vAxis['minorGridlines']['count'] ) ? $this->vAxis['minorGridlines']['count'] : '',
363 + esc_html__( 'Specify 0 to disable the minor gridlines.', 'visualizer' ),
364 + 0,
365 + 'number',
366 + array( 'min' => 0, 'step' => 1 )
320 367 );
321 368
322 369 self::_renderColorPickerItem(
323 370 esc_html__( 'Color', 'visualizer' ),
324 - 'hAxis[minorGridlines][color]',
325 - isset( $this->hAxis['minorGridlines']['color'] ) ? $this->hAxis['minorGridlines']['color'] : null,
371 + 'vAxis[minorGridlines][color]',
372 + isset( $this->vAxis['minorGridlines']['color'] ) ? $this->vAxis['minorGridlines']['color'] : null,
326 373 null
327 374 );
328 375 self::_renderSectionEnd();
329 376 }
330 377
331 - if ( $this->_horizontalGridLines ) {
378 + if ( $this->_verticalGridLines ) {
332 379 self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false );
333 380 self::_renderTextItem(
334 381 esc_html__( 'Maximum Value', 'visualizer' ),
335 382 'vAxis[viewWindow][max]',
@@ -368,8 +415,12 @@
368 415 * @access protected
369 416 */
370 417 protected function _renderSeriesSettings() {
371 418 self::_renderGroupStart( esc_html__( 'Series Settings', 'visualizer' ) );
419 + self::_renderSectionStart();
420 + self::_renderSectionDescription( esc_html__( 'If you have just updated/modified the chart data, you may need to save it before the new data reflects in the settings.', 'visualizer' ), 'viz-info-msg' );
421 + self::_renderSectionEnd();
422 +
372 423 for ( $i = 1, $cnt = count( $this->__series ); $i < $cnt; $i++ ) {
373 424 if ( ! empty( $this->__series[ $i ]['label'] ) ) {
374 425 self::_renderSectionStart( esc_html( $this->__series[ $i ]['label'] ), false );
375 426 $this->_renderSeries( $i - 1 );
@@ -407,8 +458,11 @@
407 458 'series[' . $index . '][color]',
408 459 isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null,
409 460 null
410 461 );
462 +
463 + $this->_renderRoleField( $index );
464 +
411 465 }
412 466
413 467 /**
414 468 * Renders format field for horizontal axis.
@@ -425,15 +479,17 @@
425 479 sprintf(
426 480 '%s<br><br>%s<br><br>%s',
427 481 esc_html__( 'Enter custom format pattern to apply to horizontal axis labels.', 'visualizer' ),
428 482 sprintf(
483 + // translators: %1$s - HTML link tag, %2$s - HTML closing link tag.
429 484 esc_html__( 'For number axis labels, this is a subset of the decimal formatting %1$sICU pattern set%2$s. For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #&#37;&#37; percentage format then your values will be multiplied by 100.', 'visualizer' ),
430 485 '<a href="http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details" target="_blank">',
431 486 '</a>'
432 487 ),
433 488 sprintf(
489 + // translators: %1$s - HTML link tag, %2$s - HTML closing link tag.
434 490 esc_html__( 'For date axis labels, this is a subset of the date formatting %1$sICU date and time format%2$s.', 'visualizer' ),
435 - '<a href="http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax" target="_blank">',
491 + '<a href="https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax" target="_blank">',
436 492 '</a>'
437 493 )
438 494 )
439 495 );
@@ -454,15 +510,17 @@
454 510 sprintf(
455 511 '%s<br><br>%s<br><br>%s',
456 512 esc_html__( 'Enter custom format pattern to apply to vertical axis labels.', 'visualizer' ),
457 513 sprintf(
514 + // translators: %1$s - HTML link tag, %2$s - HTML closing link tag.
458 515 esc_html__( 'For number axis labels, this is a subset of the decimal formatting %1$sICU pattern set%2$s. For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #&#37;&#37; percentage format then your values will be multiplied by 100.', 'visualizer' ),
459 516 '<a href="http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details" target="_blank">',
460 517 '</a>'
461 518 ),
462 519 sprintf(
520 + // translators: %1$s - HTML link tag, %2$s - HTML closing link tag.
463 521 esc_html__( 'For date axis labels, this is a subset of the date formatting %1$sICU date and time format%2$s.', 'visualizer' ),
464 - '<a href="http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax" target="_blank">',
522 + '<a href="https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax" target="_blank">',
465 523 '</a>'
466 524 )
467 525 )
468 526 );