PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.3.0
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.3.0
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 -68 4.0.43.3.0 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.
@@ -105,12 +94,8 @@
105 94 * @access protected
106 95 */
107 96 protected function _renderSeriesSettings() {
108 97 self::_renderGroupStart( esc_html__( 'Series Settings', 'visualizer' ) );
109 - self::_renderSectionStart();
110 - 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' );
111 - self::_renderSectionEnd();
112 -
113 98 for ( $i = 1, $cnt = count( $this->__series ); $i < $cnt; $i++ ) {
114 99 if ( ! empty( $this->__series[ $i ]['label'] ) ) {
115 100 self::_renderSectionStart( esc_html( $this->__series[ $i ]['label'] ), false );
116 101 $this->_renderSeries( $i - 1 );
@@ -130,8 +115,9 @@
130 115 */
131 116 protected function _renderSeries( $index ) {
132 117 $this->_renderFormatField( $index );
133 118 $this->_renderChartTypeSeries( $index );
119 +
134 120 }
135 121
136 122 /**
137 123 * Renders template.
@@ -170,21 +156,8 @@
170 156 isset( $this->title['fontColor'] ) ? $this->title['fontColor'] : '',
171 157 '#000'
172 158 );
173 159
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 160 }
188 161
189 162 /**
190 163 * Renders chart general settings group.
@@ -205,9 +178,9 @@
205 178
206 179 self::_renderSectionStart( esc_html__( 'Font Styles', 'visualizer' ), false );
207 180 echo '<div class="viz-section-item">';
208 181 echo '<a class="more-info" href="javascript:;">[?]</a>';
209 - echo '<b>', esc_html__( 'Font Family And Size', 'visualizer' ), '</b>';
182 + echo '<b>', esc_html__( 'Family And Size', 'visualizer' ), '</b>';
210 183
211 184 echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">';
212 185 echo '<tr>';
213 186 echo '<td class="viz-section-table-column">';
@@ -243,9 +216,9 @@
243 216 'legend[position]',
244 217 // let's have a default otherwise the chart behaves weird when hovering in edit mode
245 218 isset( $this->legend['position'] ) ? $this->legend['position'] : 'top',
246 219 $this->_legendPositions,
247 - esc_html__( 'Sets the legend position relative to the chart.', 'visualizer' )
220 + esc_html__( 'Determines where to place the legend, compared to the chart area.', 'visualizer' )
248 221 );
249 222
250 223 self::_renderCheckboxItem(
251 224 esc_html__( 'Show datasets in reverse order', 'visualizer' ),
@@ -256,9 +229,9 @@
256 229 );
257 230
258 231 echo '<div class="viz-section-item">';
259 232 echo '<a class="more-info" href="javascript:;">[?]</a>';
260 - echo '<b>', esc_html__( 'Font Family And Size', 'visualizer' ), '</b>';
233 + echo '<b>', esc_html__( 'Family And Size', 'visualizer' ), '</b>';
261 234
262 235 echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">';
263 236 echo '<tr>';
264 237 echo '<td class="viz-section-table-column">';
@@ -298,25 +271,8 @@
298 271 self::_renderSectionEnd();
299 272
300 273 $this->_renderAnimationSettings();
301 274
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 275 self::_renderGroupEnd();
320 276 }
321 277
322 278 /**
@@ -362,8 +318,9 @@
362 318 esc_html__( 'The easing function applied to the animation.', 'visualizer' )
363 319 );
364 320
365 321 self::_renderSectionEnd();
322 +
366 323 }
367 324
368 325 /**
369 326 * Renders tooltip settings section.
@@ -386,18 +343,9 @@
386 343 * Add the correct description for the manual configuration box.
387 344 */
388 345 protected function _renderManualConfigDescription() {
389 346 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 - );
347 + 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 348 }
401 349
402 350 /**
403 351 * Add the correct example for the manual configuration box.
@@ -402,15 +350,12 @@
402 350 /**
403 351 * Add the correct example for the manual configuration box.
404 352 */
405 353 protected function _renderManualConfigExample() {
406 - return json_encode(
407 - array(
408 - 'cutoutPercentage' => 5,
409 - 'rotation' => 60,
410 - ),
411 - JSON_PRETTY_PRINT
412 - );
354 + return '{
355 + "cutoutPercentage": 5,
356 + "rotation": 60
357 + }';
413 358 }
414 359
415 360 /**
416 361 * Renders chart view settings group.