RomanL 8 anni fa
parent
commit
567ef09b2b

+ 2 - 2
modules/boonex/analytics/classes/BxAnalyticsModule.php

@@ -175,7 +175,7 @@ class BxAnalyticsModule extends BxDolModule
             }
             
             $sRv .= $sTxt . $sColumn;
-            for ($i = 0; $i < $iColumnCount; $i++) {
+            for ($i = 0; $i < $iColumnCount; $i++){
                 $sText = '';
                 if (is_array($aItemData)) {
                     $sText = $aItemData['y'];
@@ -251,7 +251,7 @@ class BxAnalyticsModule extends BxDolModule
                             array_push($aValues['values'][0]['data'], array('x' => $sX, 'y' => $sReportName == BX_ANALYTICS_CONTENT_TOTAL ? ($iValuePrev + $aTmpDates[$sX]) : $aTmpDates[$sX]));
                             $iValuePrev += $aTmpDates[$sX];
                         }
-                        array_push($aValues['labels'], $sX);
+                        //array_push($aValues['labels'], $sX);
                         if ($sReportName == BX_ANALYTICS_CONTENT_TOTAL){
                             if ($iValuePrev > $iMaxValueY)
                                 $iMaxValueY = $iValuePrev;

+ 9 - 8
modules/boonex/analytics/js/analytics.js

@@ -77,6 +77,8 @@ BxAnalytics.prototype.reloadData = function () {
             else
                 return label;
         };
+
+        
         
         bx_loading($($this._sContainerDataSelector), false);
         var oDataForChart = oData.data || false;
@@ -94,7 +96,7 @@ BxAnalytics.prototype.reloadData = function () {
 
 BxAnalytics.prototype.dataToTable = function (oDataIn) {
     var $this = this;
-    oData = oDataIn.data
+    oData = oDataIn.data.clone();
     var sHtml = '<table>';
     var sCol1 = oDataIn.strings[0];
 
@@ -107,17 +109,16 @@ BxAnalytics.prototype.dataToTable = function (oDataIn) {
 
     sHtml += '</tr></thead>';
     var iK = 0;
-
-    if (oData.labels.length == 0) {
+    console.log(oDataIn.options.scales.xAxes[0].type == 'time');
+    if (oDataIn.options.scales.xAxes[0].type == 'time') {
         oData.datasets[0].data.reverse();
     }
-
-    $.each(oData.datasets[0].data, function (iDx, oItemData) {
+    oData.datasets[0].data.forEach(function (oItemData, iDx) {
         var sTxt = "";
-        if (oData.labels.length > 0)
-            sTxt = oData.labels[iDx];
-        else{
+        if (oDataIn.options.scales.xAxes[0].type == 'time')
             sTxt = oData.datasets[0].data[iDx].x;
+        else{
+            sTxt = oData.labels[iDx];
         }
         if (oDataIn.links && oDataIn.links.length > 0) {
             sTxt = "<a href='" + oDataIn.links[iDx] + "'>" + sTxt + "</a>"

File diff suppressed because it is too large
+ 0 - 0
modules/boonex/analytics/plugins/datatables/datatables.min.css


Some files were not shown because too many files changed in this diff