Browse Source

Fix most popular ingredients not displaying numbers correctly

Lee Morgan 6 năm trước cách đây
mục cha
commit
74bcb1364f

+ 1 - 1
views/dashboardPage/home.js

@@ -128,7 +128,7 @@ window.homeStrandObj = {
 
 
                 dataArray.push({
                 dataArray.push({
                     num: max,
                     num: max,
-                    label: `${ingredientList[index].name}: ${ingredientList[index].quantity} ${ingredientList[index].unit}`
+                    label: `${ingredientList[index].name}: ${+ingredientList[index].quantity.toFixed(2)} ${ingredientList[index].unit}`
                 });
                 });
                 ingredientList.splice(index, 1);
                 ingredientList.splice(index, 1);
             }
             }

+ 0 - 1
views/shared/graphs.js

@@ -245,7 +245,6 @@ class HorizontalBarGraph{
     //      num: number for the actual data
     //      num: number for the actual data
     //      label: text to display on bar
     //      label: text to display on bar
     addData(dataArray){
     addData(dataArray){
-        let data = [];
         this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
         this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
 
 
         for(let point of dataArray){
         for(let point of dataArray){