PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 4.0.8
Visualizer – Tables & Charts Manager with Built-in AI Generator v4.0.8
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 +94 -39 3.0.74.0.8 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,22 @@
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 + );
125 139 }
126 140
127 141 /**
128 142 * Renders general settings block for horizontal axis settings.
@@ -139,11 +153,36 @@
139 153 esc_html__( 'The title of the horizontal axis.', 'visualizer' )
140 154 );
141 155
142 156 self::_renderSelectItem(
157 + esc_html__( 'Slanted Text', 'visualizer' ),
158 + 'hAxis[slantedText]',
159 + isset( $this->hAxis['slantedText'] ) ? $this->hAxis['slantedText'] : false,
160 + array(
161 + false => 'False',
162 + true => 'True',
163 + ),
164 + '',
165 + false
166 + );
167 +
168 + self::_renderTextItem(
169 + esc_html__( 'Slanted Text Angle', 'visualizer' ),
170 + 'hAxis[slantedTextAngle]',
171 + isset( $this->hAxis['slantedTextAngle'] ) ? $this->hAxis['slantedTextAngle'] : 45,
172 + '',
173 + 45,
174 + 'number',
175 + array(
176 + 'min' => 1,
177 + 'step' => 15,
178 + )
179 + );
180 +
181 + self::_renderSelectItem(
143 182 esc_html__( 'Text Position', 'visualizer' ),
144 - 'vAxis[textPosition]',
145 - isset( $this->vAxis['textPosition'] ) ? $this->vAxis['textPosition'] : '',
183 + 'hAxis[textPosition]',
184 + isset( $this->hAxis['textPosition'] ) ? $this->hAxis['textPosition'] : '',
146 185 $this->_positions,
147 186 esc_html__( 'Position of the horizontal axis text, relative to the chart area.', 'visualizer' )
148 187 );
149 188
@@ -152,9 +191,9 @@
152 191 'hAxis[direction]',
153 192 isset( $this->hAxis['direction'] ) ? $this->hAxis['direction'] : '',
154 193 array(
155 194 '' => '',
156 - '1' => esc_html__( 'Identical Direction', 'visualizer' ),
195 + '1' => esc_html__( 'Default Direction', 'visualizer' ),
157 196 '-1' => esc_html__( 'Reverse Direction', 'visualizer' ),
158 197 ),
159 198 esc_html__( 'The direction in which the values along the horizontal axis grow.', 'visualizer' )
160 199 );
@@ -178,23 +217,24 @@
178 217 self::_renderGroupStart( esc_html__( 'Horizontal Axis Settings', 'visualizer' ) );
179 218 self::_renderSectionStart( esc_html__( 'General Settings', 'visualizer' ), false );
180 219 $this->_renderHorizontalAxisGeneralSettings();
181 220 self::_renderSectionEnd();
182 -
183 221 if ( $this->_horizontalGridLines ) {
184 222 self::_renderSectionStart( esc_html__( 'Grid Lines', 'visualizer' ), false );
185 223 self::_renderTextItem(
186 224 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
225 + 'hAxis[gridlines][count]',
226 + isset( $this->hAxis['gridlines']['count'] ) ? $this->hAxis['gridlines']['count'] : '',
227 + 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' ),
228 + 5,
229 + 'number',
230 + array( 'min' => -1, 'max' => 1000, 'step' => 1 )
191 231 );
192 232
193 233 self::_renderColorPickerItem(
194 234 esc_html__( 'Color', 'visualizer' ),
195 - 'vAxis[gridlines][color]',
196 - isset( $this->vAxis['gridlines']['color'] ) ? $this->vAxis['gridlines']['color'] : null,
235 + 'hAxis[gridlines][color]',
236 + isset( $this->hAxis['gridlines']['color'] ) ? $this->hAxis['gridlines']['color'] : null,
197 237 '#ccc'
198 238 );
199 239 self::_renderSectionEnd();
200 240
@@ -200,24 +240,26 @@
200 240
201 241 self::_renderSectionStart( esc_html__( 'Minor Grid Lines', 'visualizer' ), false );
202 242 self::_renderTextItem(
203 243 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
244 + 'hAxis[minorGridlines][count]',
245 + isset( $this->hAxis['minorGridlines']['count'] ) ? $this->hAxis['minorGridlines']['count'] : '',
246 + esc_html__( 'Specify 0 to disable the minor gridlines.', 'visualizer' ),
247 + 0,
248 + 'number',
249 + array( 'min' => 0, 'step' => 1 )
208 250 );
209 251
210 252 self::_renderColorPickerItem(
211 253 esc_html__( 'Color', 'visualizer' ),
212 - 'vAxis[minorGridlines][color]',
213 - isset( $this->vAxis['minorGridlines']['color'] ) ? $this->vAxis['minorGridlines']['color'] : null,
254 + 'hAxis[minorGridlines][color]',
255 + isset( $this->hAxis['minorGridlines']['color'] ) ? $this->hAxis['minorGridlines']['color'] : null,
214 256 null
215 257 );
216 258 self::_renderSectionEnd();
217 259 }
218 260
219 - if ( $this->_verticalGridLines ) {
261 + if ( $this->_horizontalGridLines ) {
220 262 self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false );
221 263 self::_renderTextItem(
222 264 esc_html__( 'Maximum Value', 'visualizer' ),
223 265 'hAxis[viewWindow][max]',
@@ -252,10 +294,10 @@
252 294 );
253 295
254 296 self::_renderSelectItem(
255 297 esc_html__( 'Text Position', 'visualizer' ),
256 - 'hAxis[textPosition]',
257 - isset( $this->hAxis['textPosition'] ) ? $this->hAxis['textPosition'] : '',
298 + 'vAxis[textPosition]',
299 + isset( $this->vAxis['textPosition'] ) ? $this->vAxis['textPosition'] : '',
258 300 $this->_positions,
259 301 esc_html__( 'Position of the vertical axis text, relative to the chart area.', 'visualizer' )
260 302 );
261 303
@@ -264,9 +306,9 @@
264 306 'vAxis[direction]',
265 307 isset( $this->vAxis['direction'] ) ? $this->vAxis['direction'] : '',
266 308 array(
267 309 '' => '',
268 - '1' => esc_html__( 'Identical Direction', 'visualizer' ),
310 + '1' => esc_html__( 'Default Direction', 'visualizer' ),
269 311 '-1' => esc_html__( 'Reverse Direction', 'visualizer' ),
270 312 ),
271 313 esc_html__( 'The direction in which the values along the vertical axis grow.', 'visualizer' )
272 314 );
@@ -295,18 +337,20 @@
295 337 if ( $this->_verticalGridLines ) {
296 338 self::_renderSectionStart( esc_html__( 'Grid Lines', 'visualizer' ), false );
297 339 self::_renderTextItem(
298 340 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
341 + 'vAxis[gridlines][count]',
342 + isset( $this->vAxis['gridlines']['count'] ) ? $this->vAxis['gridlines']['count'] : '',
343 + 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' ),
344 + 5,
345 + 'number',
346 + array( 'min' => -1, 'max' => 1000, 'step' => 1 )
303 347 );
304 348
305 349 self::_renderColorPickerItem(
306 350 esc_html__( 'Color', 'visualizer' ),
307 - 'hAxis[gridlines][color]',
308 - isset( $this->hAxis['gridlines']['color'] ) ? $this->hAxis['gridlines']['color'] : null,
351 + 'vAxis[gridlines][color]',
352 + isset( $this->vAxis['gridlines']['color'] ) ? $this->vAxis['gridlines']['color'] : null,
309 353 '#ccc'
310 354 );
311 355 self::_renderSectionEnd();
312 356
@@ -312,24 +356,26 @@
312 356
313 357 self::_renderSectionStart( esc_html__( 'Minor Grid Lines', 'visualizer' ), false );
314 358 self::_renderTextItem(
315 359 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
360 + 'vAxis[minorGridlines][count]',
361 + isset( $this->vAxis['minorGridlines']['count'] ) ? $this->vAxis['minorGridlines']['count'] : '',
362 + esc_html__( 'Specify 0 to disable the minor gridlines.', 'visualizer' ),
363 + 0,
364 + 'number',
365 + array( 'min' => 0, 'step' => 1 )
320 366 );
321 367
322 368 self::_renderColorPickerItem(
323 369 esc_html__( 'Color', 'visualizer' ),
324 - 'hAxis[minorGridlines][color]',
325 - isset( $this->hAxis['minorGridlines']['color'] ) ? $this->hAxis['minorGridlines']['color'] : null,
370 + 'vAxis[minorGridlines][color]',
371 + isset( $this->vAxis['minorGridlines']['color'] ) ? $this->vAxis['minorGridlines']['color'] : null,
326 372 null
327 373 );
328 374 self::_renderSectionEnd();
329 375 }
330 376
331 - if ( $this->_horizontalGridLines ) {
377 + if ( $this->_verticalGridLines ) {
332 378 self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false );
333 379 self::_renderTextItem(
334 380 esc_html__( 'Maximum Value', 'visualizer' ),
335 381 'vAxis[viewWindow][max]',
@@ -368,8 +414,12 @@
368 414 * @access protected
369 415 */
370 416 protected function _renderSeriesSettings() {
371 417 self::_renderGroupStart( esc_html__( 'Series Settings', 'visualizer' ) );
418 + self::_renderSectionStart();
419 + 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' );
420 + self::_renderSectionEnd();
421 +
372 422 for ( $i = 1, $cnt = count( $this->__series ); $i < $cnt; $i++ ) {
373 423 if ( ! empty( $this->__series[ $i ]['label'] ) ) {
374 424 self::_renderSectionStart( esc_html( $this->__series[ $i ]['label'] ), false );
375 425 $this->_renderSeries( $i - 1 );
@@ -407,8 +457,10 @@
407 457 'series[' . $index . '][color]',
408 458 isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null,
409 459 null
410 460 );
461 +
462 + $this->_renderRoleField( $index );
411 463 }
412 464
413 465 /**
414 466 * Renders format field for horizontal axis.
@@ -425,15 +477,17 @@
425 477 sprintf(
426 478 '%s<br><br>%s<br><br>%s',
427 479 esc_html__( 'Enter custom format pattern to apply to horizontal axis labels.', 'visualizer' ),
428 480 sprintf(
429 - 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' ),
481 + // translators: %1$s - HTML link tag, %2$s - HTML closing link tag.
482 + 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. Note: Using the #&#37;&#37; percentage format will multiply your values by 100.', 'visualizer' ),
430 483 '<a href="http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details" target="_blank">',
431 484 '</a>'
432 485 ),
433 486 sprintf(
487 + // translators: %1$s - HTML link tag, %2$s - HTML closing link tag.
434 488 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">',
489 + '<a href="https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax" target="_blank">',
436 490 '</a>'
437 491 )
438 492 )
439 493 );
@@ -454,18 +508,19 @@
454 508 sprintf(
455 509 '%s<br><br>%s<br><br>%s',
456 510 esc_html__( 'Enter custom format pattern to apply to vertical axis labels.', 'visualizer' ),
457 511 sprintf(
458 - 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' ),
512 + // translators: %1$s - HTML link tag, %2$s - HTML closing link tag.
513 + 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. Note: Using the #&#37;&#37; percentage format will multiply your values by 100.', 'visualizer' ),
459 514 '<a href="http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details" target="_blank">',
460 515 '</a>'
461 516 ),
462 517 sprintf(
518 + // translators: %1$s - HTML link tag, %2$s - HTML closing link tag.
463 519 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">',
520 + '<a href="https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax" target="_blank">',
465 521 '</a>'
466 522 )
467 523 )
468 524 );
469 525 }
470 -
471 526 }