Răsfoiți Sursa

Clicking on anal tabs displayed a tiny graph.

Lee Morgan 5 ani în urmă
părinte
comite
2dbf53852c
1 a modificat fișierele cu 2 adăugiri și 27 ștergeri
  1. 2 27
      views/dashboardPage/js/strands/analytics.js

+ 2 - 27
views/dashboardPage/js/strands/analytics.js

@@ -232,31 +232,6 @@ let analytics = {
     displayCategory: function(){
         if(this.category === undefined) this.category = merchant.categorizeIngredients()[0];
 
-        // let startOfDay = new Date();
-        // startOfDay.setHours(0, 0, 0, 0);
-        // let endOfDay = new Date();
-        // endOfDay.setDate(endOfDay.getDate() + 1);
-        // endOfDay.setHours(0, 0, 0, 0);
-
-        // let dates = [];
-        // let quantities = [];
-
-        // for(let i = 0; i < 30; i++){
-        //     dates.push(new Date(startOfDay));
-        //     let transactions = merchant.getTransactions(startOfDay, endOfDay);
-
-        //     let quantity = 0;
-        //     for(let j = 0; j < transactions.length; j++){
-        //         for(let k = 0; k < this.category.ingredients.length; k++){
-        //             quantity += transactions[j].getIngredientQuantity(this.category.ingredients[k].ingredient);
-        //         }
-        //     }
-
-        //     startOfDay.setDate(startOfDay.getDate() - 1);
-        //     endOfDay.setDate(endOfDay.getDate() - 1);
-        //     quantities.push(quantity);
-        // }
-
         let dates = [];
         let quantities = [];
 
@@ -404,12 +379,12 @@ let analytics = {
 
         switch(tab.innerText.toLowerCase()){
             case "ingredients":
-                this.displayIngredient();
                 ingredientContent.style.display = "flex";
+                this.displayIngredient();
                 break;
             case "categories":
-                this.displayCategory();
                 categoryContent.style.display = "flex";
+                this.displayCategory();
                 break;
             case "recipes":
                 recipeContent.style.display = "flex";