PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.3.1
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.3.1
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/ChartJS.php +13 -64 4.0.53.3.1 View file →
@@ -12,19 +12,8 @@
12 12 */
13 13 abstract class Visualizer_Render_Sidebar_ChartJS extends Visualizer_Render_Sidebar {
14 14
15 15 /**
16 - * The array of available legend positions.
17 - *
18 - * @since 1.0.0
19 - *
20 - * @access protected
21 - * @var array
22 - */
23 - protected $_legendPositions;
24 -
25 -
26 - /**
27 16 * The constructor.
28 17 */
29 18 public function __construct( $data = array() ) {
30 19 $this->_library = 'chartjs';
@@ -34,11 +23,10 @@
34 23 'left' => esc_html__( 'Left of the chart', 'visualizer' ),
35 24 'right' => esc_html__( 'Right of the chart', 'visualizer' ),
36 25 'top' => esc_html__( 'Above the chart', 'visualizer' ),
37 26 'bottom' => esc_html__( 'Below the chart', 'visualizer' ),
38 - 'bottom' => esc_html__( 'Below the chart', 'visualizer' ),
39 - 'none' => esc_html__( 'Omit the legend', 'visualizer' ),
40 27 );
28 +
41 29 }
42 30
43 31 /**
44 32 * Renders concrete series settings for the Bar chart.
@@ -76,9 +64,9 @@
76 64
77 65 /**
78 66 * Loads the assets.
79 67 */
80 - public function load_chartjs_assets( $deps, $is_frontend ) {
68 + function load_chartjs_assets( $deps, $is_frontend ) {
81 69 $this->load_dependent_assets( array( 'moment', 'numeral' ) );
82 70
83 71 wp_register_script( 'chartjs', VISUALIZER_ABSURL . 'js/lib/chartjs.min.js', array( 'numeral', 'moment' ), null, true );
84 72 wp_register_script(
@@ -94,8 +82,9 @@
94 82 return array_merge(
95 83 $deps,
96 84 array( 'visualizer-render-chartjs-lib' )
97 85 );
86 +
98 87 }
99 88
100 89 /**
101 90 * Renders series settings group.
@@ -130,8 +119,9 @@
130 119 */
131 120 protected function _renderSeries( $index ) {
132 121 $this->_renderFormatField( $index );
133 122 $this->_renderChartTypeSeries( $index );
123 +
134 124 }
135 125
136 126 /**
137 127 * Renders template.
@@ -170,21 +160,8 @@
170 160 isset( $this->title['fontColor'] ) ? $this->title['fontColor'] : '',
171 161 '#000'
172 162 );
173 163
174 - echo '<div class="viz-section-delimiter"></div>';
175 -
176 - self::_renderTextAreaItem(
177 - esc_html__( 'Chart Description', 'visualizer' ),
178 - 'description',
179 - $this->description,
180 - sprintf(
181 - // translators: %1$s - HTML link tag, %2$s - HTML closing link tag.
182 - esc_html__( 'Description to display in the structured data schema as explained %1$shere%2$s', 'visualizer' ),
183 - '<a href="https://developers.google.com/search/docs/data-types/dataset#dataset" target="_blank">',
184 - '</a>'
185 - )
186 - );
187 164 }
188 165
189 166 /**
190 167 * Renders chart general settings group.
@@ -205,9 +182,9 @@
205 182
206 183 self::_renderSectionStart( esc_html__( 'Font Styles', 'visualizer' ), false );
207 184 echo '<div class="viz-section-item">';
208 185 echo '<a class="more-info" href="javascript:;">[?]</a>';
209 - echo '<b>', esc_html__( 'Font Family And Size', 'visualizer' ), '</b>';
186 + echo '<b>', esc_html__( 'Family And Size', 'visualizer' ), '</b>';
210 187
211 188 echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">';
212 189 echo '<tr>';
213 190 echo '<td class="viz-section-table-column">';
@@ -243,9 +220,9 @@
243 220 'legend[position]',
244 221 // let's have a default otherwise the chart behaves weird when hovering in edit mode
245 222 isset( $this->legend['position'] ) ? $this->legend['position'] : 'top',
246 223 $this->_legendPositions,
247 - esc_html__( 'Sets the legend position relative to the chart.', 'visualizer' )
224 + esc_html__( 'Determines where to place the legend, compared to the chart area.', 'visualizer' )
248 225 );
249 226
250 227 self::_renderCheckboxItem(
251 228 esc_html__( 'Show datasets in reverse order', 'visualizer' ),
@@ -256,9 +233,9 @@
256 233 );
257 234
258 235 echo '<div class="viz-section-item">';
259 236 echo '<a class="more-info" href="javascript:;">[?]</a>';
260 - echo '<b>', esc_html__( 'Font Family And Size', 'visualizer' ), '</b>';
237 + echo '<b>', esc_html__( 'Family And Size', 'visualizer' ), '</b>';
261 238
262 239 echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">';
263 240 echo '<tr>';
264 241 echo '<td class="viz-section-table-column">';
@@ -298,25 +275,8 @@
298 275 self::_renderSectionEnd();
299 276
300 277 $this->_renderAnimationSettings();
301 278
302 - self::_renderSectionStart( esc_html__( 'License & Creator', 'visualizer' ), false );
303 - self::_renderTextItem(
304 - esc_html__( 'License', 'visualizer' ),
305 - 'license',
306 - $this->license,
307 - ''
308 - );
309 - self::_renderTextItem(
310 - esc_html__( 'Creator', 'visualizer' ),
311 - 'creator',
312 - $this->creator,
313 - ''
314 - );
315 - self::_renderSectionEnd();
316 -
317 - self::_renderChartImageSettings();
318 -
319 279 self::_renderGroupEnd();
320 280 }
321 281
322 282 /**
@@ -362,8 +322,9 @@
362 322 esc_html__( 'The easing function applied to the animation.', 'visualizer' )
363 323 );
364 324
365 325 self::_renderSectionEnd();
326 +
366 327 }
367 328
368 329 /**
369 330 * Renders tooltip settings section.
@@ -386,18 +347,9 @@
386 347 * Add the correct description for the manual configuration box.
387 348 */
388 349 protected function _renderManualConfigDescription() {
389 350 self::_renderSectionStart();
390 - self::_renderSectionDescription(
391 - '<span class="viz-gvlink">' . sprintf(
392 - // translators: %1$s - HTML link tag, %2$s - HTML closing link tag, %3$s - HTML link tag, %4$s - HTML closing link tag.
393 - __( 'Configure the graph by providing configuration variables right from the %1$sChartJS API%2$s. You can refer to %3$sCommon Snippets%4$s for examples.', 'visualizer' ),
394 - '<a href="https://www.chartjs.org/docs/latest/configuration/" target="_blank">',
395 - '</a>',
396 - '<a href="https://docs.themeisle.com/article/728-manual-configuration" target="_blank">',
397 - '</a>'
398 - ) . '</span>'
399 - );
351 + self::_renderSectionDescription( '<span class="viz-gvlink">' . sprintf( __( 'Configure the graph by providing configuration variables right from the %1$sChartJS API%2$s. You can refer to to some examples %3$shere%4$s.', 'visualizer' ), '<a href="https://www.chartjs.org/docs/latest/configuration/" target="_blank">', '</a>', '<a href="https://docs.themeisle.com/article/728-manual-configuration" target="_blank">', '</a>' ) . '</span>' );
400 352 }
401 353
402 354 /**
403 355 * Add the correct example for the manual configuration box.
@@ -402,15 +354,12 @@
402 354 /**
403 355 * Add the correct example for the manual configuration box.
404 356 */
405 357 protected function _renderManualConfigExample() {
406 - return json_encode(
407 - array(
408 - 'cutoutPercentage' => 5,
409 - 'rotation' => 60,
410 - ),
411 - JSON_PRETTY_PRINT
412 - );
358 + return '{
359 + "cutoutPercentage": 5,
360 + "rotation": 60
361 + }';
413 362 }
414 363
415 364 /**
416 365 * Renders chart view settings group.