PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.7.9
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.7.9
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 3.10.4 All 148 releases
← All changes | js/render-chartjs.js +15 -61 3.10.03.7.9 View file →
@@ -64,9 +64,9 @@
64 64
65 65 for (i = 0; i < data.length; i++) {
66 66 row = [];
67 67 for (j = 0; j < series.length; j++) {
68 - if (series[j].type === 'date' || series[j].type === 'datetime') {
68 + if (series[j].type === 'date' || series[j].type === 'datetime') {
69 69 date = new Date(data[i][j]);
70 70 data[i][j] = null;
71 71 if (Object.prototype.toString.call(date) === "[object Date]") {
72 72 if (!isNaN(date.getTime())) {
@@ -112,42 +112,8 @@
112 112 }
113 113
114 114 handleSettings(settings, chart);
115 115
116 - const getChart = Chart.getChart(context);
117 - if ( getChart ) {
118 - return;
119 - }
120 -
121 - // Format series label.
122 - settings.plugins.tooltip = {
123 - callbacks: {
124 - label: function(context) {
125 - var label = '';
126 - if ( 'object' === typeof context.dataset.label ) {
127 - label = context.label || '';
128 - } else {
129 - label = context.dataset.label || '';
130 - }
131 - if ( label ) {
132 - label += ': ';
133 - }
134 - var format = context.dataset.format || '';
135 - if ( format ) {
136 - label += format_datum( context.formattedValue, format );
137 - } else {
138 - format = 'undefined' !== typeof context.chart.config._config.options.format ? context.chart.config._config.options.format : '';
139 - if ( format ) {
140 - label += format_datum( context.formattedValue, format );
141 - } else {
142 - label += context.formattedValue;
143 - }
144 - }
145 - return label;
146 - }
147 - }
148 - };
149 -
150 116 var chartjs = new Chart(context, {
151 117 type: type,
152 118 data: {
153 119 labels: labels,
@@ -159,9 +125,9 @@
159 125 var canvas = $( 'canvas' )[0];
160 126 if ( $( '#chart-img' ).length ) {
161 127 $( '#chart-img' ).val( canvas.toDataURL() );
162 128 }
163 - }
129 + },
164 130 }],
165 131 });
166 132
167 133 // this line needs to be included twice. This is not an error.
@@ -225,12 +191,8 @@
225 191 }
226 192 }
227 193 }
228 194
229 - settings.plugins = {
230 - legend: settings.legend,
231 - };
232 -
233 195 handleAxes(settings, chart);
234 196
235 197 override(settings, chart);
236 198 }
@@ -386,24 +348,21 @@
386 348
387 349 // format the axes labels.
388 350 if(typeof settings[axis + '_format'] !== 'undefined' && settings[axis + '_format'] !== ''){
389 351 var format = settings[axis + '_format'];
390 - var isDateFormat = moment( moment().format( format ),format, true ).isValid();
391 - if ( ! isDateFormat ) {
392 - switch(axis){
393 - case 'xAxes':
394 - settings.scales.x.ticks.callback = function(value, index, values){
395 - return format_datum(value, format);
396 - };
397 - break;
398 - case 'yAxes':
399 - settings.scales.y.ticks.callback = function(value, index, values){
400 - return format_datum(value, format);
401 - };
402 - break;
403 - }
404 - delete settings[axis + '_format'];
405 - }
352 + switch(axis){
353 + case 'xAxes':
354 + settings.scales.x.ticks.callback = function(value, index, values){
355 + return format_datum(value, format);
356 + };
357 + break;
358 + case 'yAxes':
359 + settings.scales.y.ticks.callback = function(value, index, values){
360 + return format_datum(value, format);
361 + };
362 + break;
363 + }
364 + delete settings[axis + '_format'];
406 365 }
407 366 delete settings[axis];
408 367 }
409 368
@@ -485,13 +444,8 @@
485 444
486 445 function format_data(datum, j, settings, series){
487 446 j = j - 1;
488 447 var format = typeof settings.series !== 'undefined' && typeof settings.series[j] !== 'undefined' ? settings.series[j].format : '';
489 - if ( '' === format && typeof settings.yAxes_format !== 'undefined' ) {
490 - format = settings.yAxes_format;
491 - } else if ( '' === format && typeof settings.xAxes_format !== 'undefined' ) {
492 - format = settings.xAxes_format;
493 - }
494 448 return format_datum(datum, format, series[j + 1].type);
495 449 }
496 450
497 451 function override(settings, chart) {