PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.10.0
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.10.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 | js/render-chartjs.js +10 -18 4.0.83.10.0 View file →
@@ -18,13 +18,8 @@
18 18
19 19 if(chart.library !== 'chartjs'){
20 20 return;
21 21 }
22 -
23 - // Bail if the chart is already rendered or is being rendered.
24 - if ( ! window.isResizeRequest && ( $('#' + id).hasClass('visualizer-chart-loaded') || ( 'canvas' !== id && $('#' + id).children( ':not(.loader, style)' ).length > 0 ) ) ) {
25 - return;
26 - }
27 22 rendered_charts[id] = 'yes';
28 23
29 24 series = chart.series;
30 25 data = chart.data;
@@ -137,10 +132,9 @@
137 132 label += ': ';
138 133 }
139 134 var format = context.dataset.format || '';
140 135 if ( format ) {
141 - var lastSuffix = numeral(context.formattedValue).format(format).replace(/[0-9]/g, '');
142 - label += context.formattedValue + lastSuffix;
136 + label += format_datum( context.formattedValue, format );
143 137 } else {
144 138 format = 'undefined' !== typeof context.chart.config._config.options.format ? context.chart.config._config.options.format : '';
145 139 if ( format ) {
146 140 label += format_datum( context.formattedValue, format );
@@ -152,10 +146,8 @@
152 146 }
153 147 }
154 148 };
155 149
156 - override(settings, chart);
157 -
158 150 var chartjs = new Chart(context, {
159 151 type: type,
160 152 data: {
161 153 labels: labels,
@@ -205,8 +197,12 @@
205 197 if(typeof settings['animation'] !== 'undefined' && parseInt(settings['animation']['duration']) === 0){
206 198 settings['animation']['duration'] = 1000;
207 199 }
208 200
201 + if(typeof settings['title'] !== 'undefined' && settings['title']['text'] !== ''){
202 + settings['title']['display'] = true;
203 + }
204 +
209 205 if(typeof settings['tooltip'] !== 'undefined' && typeof settings['tooltip']['intersect'] !== 'undefined'){
210 206 // jshint ignore:line
211 207 settings['tooltip']['intersect'] = settings['tooltip']['intersect'] == true || parseInt(settings['tooltip']['intersect']) === 1; // jshint ignore:line
212 208 }
@@ -233,15 +229,11 @@
233 229 settings.plugins = {
234 230 legend: settings.legend,
235 231 };
236 232
237 - if(typeof settings['title'] !== 'undefined' && settings['title']['text'] !== ''){
238 - settings.plugins['title'] = {};
239 - settings.plugins['title']['display'] = true;
240 - settings.plugins['title']['text'] = settings['title']['text'];
241 - }
233 + handleAxes(settings, chart);
242 234
243 - handleAxes(settings, chart);
235 + override(settings, chart);
244 236 }
245 237
246 238 function handleAxes(settings, chart){
247 239 if(typeof settings['yAxes'] !== 'undefined' && typeof settings['xAxes'] !== 'undefined'){
@@ -278,9 +270,9 @@
278 270 var $o = {};
279 271 if(Array.isArray(settings[axis][i]) || typeof settings[axis][i] === 'object'){
280 272 for(var j in settings[axis][i]){
281 273 var $val = '';
282 - if(j === 'labelString'){
274 + if(j === 'labelString'){
283 275 $o['display'] = true;
284 276 $val = settings[axis][i][j];
285 277 }else if(i === 'ticks'){
286 278 // number values under ticks need to be converted to numbers or the library throws a JS error.
@@ -474,9 +466,9 @@
474 466
475 467 switch(type) {
476 468 case 'number':
477 469 // numeral.js works on 0 instead of # so we just replace that in the ICU pattern set.
478 - format = format.replace(/#/g, '0').replace(/%/g, '');
470 + format = format.replace(/#/g, '0');
479 471 // we also replace all instance of '$' as that is more relevant for ticks.
480 472 if(removeDollar){
481 473 format = format.replace(/\$/g, '');
482 474 }
@@ -505,9 +497,9 @@
505 497 function override(settings, chart) {
506 498 if (settings.manual) {
507 499 try{
508 500 var options = JSON.parse(settings.manual);
509 - $.extend(true, settings, options);
501 + $.extend(settings, options);
510 502 delete settings.manual;
511 503 }catch(error){
512 504 console.error("Error while adding manual configuration override " + settings.manual);
513 505 }