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 | js/render-google.js +19 -43 4.0.43.11.14 View file →
@@ -25,28 +25,19 @@
25 25 if ( ! chart ) {
26 26 return;
27 27 }
28 28
29 - if ( chart.library && chart.library !== 'google' && chart.library !== 'GoogleCharts' ) {
30 - return;
31 - }
32 -
33 29 // re-render the chart only if it doesn't have annotations and it is on the front-end
34 30 // this is to prevent the chart from showing "All series on a given axis must be of the same data type" during resize.
35 31 // remember, some charts do not support annotations so they should not be included in this.
36 32 var no_annotation_charts = ['tabular', 'timeline', 'gauge', 'geo', 'bubble', 'candlestick'];
37 33 if ( undefined !== chart.settings && undefined !== chart.settings.series && undefined === chart.settings.series.length ) {
38 - var seriesKeys = Object.keys( chart.settings.series );
39 - // Only convert when keys are numeric indices (PHP JSON-encoded array).
40 - // String keys (e.g. named series from manual config) must be left as-is.
41 - if ( seriesKeys.every( function( k ) { return ! isNaN( k ); } ) ) {
42 - var chartSeries = [];
43 - var chartSeriesValue = Object.values( chart.settings.series );
44 - $.each( seriesKeys, function( index, element ) {
45 - chartSeries[ element ] = chartSeriesValue[ index ];
46 - } );
47 - chart.settings.series = chartSeries;
48 - }
34 + var chartSeries = [];
35 + var chartSeriesValue = Object.values( chart.settings.series );
36 + $.each( Object.keys( chart.settings.series ), function( index, element ) {
37 + chartSeries[element] = chartSeriesValue[index];
38 + } );
39 + chart.settings.series = chartSeries;
49 40 }
50 41 if(id !== 'canvas' && typeof chart.series !== 'undefined' && typeof chart.settings.series !== 'undefined' && ! no_annotation_charts.includes(chart.type) ) {
51 42 hasAnnotation = chart.series.length - chart.settings.series.length > 1;
52 43 }
@@ -452,32 +443,21 @@
452 443 return;
453 444 }
454 445
455 446 var formatter = null;
456 - var $formatInput = $('input.control-text[name*="[format]"]').filter(function() {
457 - return $(this).val() === format;
458 - });
459 - try {
460 - switch (type) {
461 - case 'number':
462 - formatter = new gv.NumberFormat({pattern: format});
463 - break;
464 - case 'date':
465 - case 'datetime':
466 - case 'timeofday':
467 - formatter = new gv.DateFormat({pattern: format});
468 - break;
469 - }
447 + switch (type) {
448 + case 'number':
449 + formatter = new gv.NumberFormat({pattern: format});
450 + break;
451 + case 'date':
452 + case 'datetime':
453 + case 'timeofday':
454 + formatter = new gv.DateFormat({pattern: format});
455 + break;
456 + }
470 457
471 - if (formatter) {
472 - formatter.format(table, index);
473 - $formatInput.nextAll('.visualizer-format-error').remove();
474 - }
475 - } catch (e) {
476 - if ($formatInput.length) {
477 - $formatInput.nextAll('.visualizer-format-error').remove();
478 - $('<p class="visualizer-format-error" style="color:#cc0000;margin:4px 0 0"></p>').text(visualizer.l10n.invalid_format).insertAfter($formatInput);
479 - }
458 + if (formatter) {
459 + formatter.format(table, index);
480 460 }
481 461
482 462 var arr = id.split('-');
483 463 $('body').trigger('visualizer:format:chart', {id: parseInt(arr[1]), data: table, column: index});
@@ -563,12 +543,8 @@
563 543 if(v.is_front == true){ // jshint ignore:line
564 544 // check what all chart types to load.
565 545 $chart_types = [];
566 546 $.each(v.charts, function(i, c){
567 - // Only consider charts rendered by Google Charts.
568 - if ( c.library && c.library !== 'google' && c.library !== 'GoogleCharts' ) {
569 - return;
570 - }
571 547 var $type = c.type;
572 548 switch($type){
573 549 case 'bar':
574 550 case 'column':
@@ -597,9 +573,9 @@
597 573 case 'radar':
598 574 $type = null;
599 575 break;
600 576 }
601 - if($type != null && $type !== ''){
577 + if($type != null){
602 578 $chart_types.push($type);
603 579 }
604 580 });
605 581 }