Browse Source

Add axis labels to graph

Lee Morgan 5 năm trước cách đây
mục cha
commit
2e6102b1a1
2 tập tin đã thay đổi với 14 bổ sung2 xóa
  1. 7 1
      views/dashboardPage/bundle.js
  2. 7 1
      views/dashboardPage/js/analytics.js

+ 7 - 1
views/dashboardPage/bundle.js

@@ -670,7 +670,13 @@ let analytics = {
         }
 
         const layout = {
-            title: this.ingredient.ingredient.name
+            title: this.ingredient.ingredient.name,
+            xaxis: {
+                title: "DATE"
+            },
+            yaxis: {
+                title: `QUANTITY (${this.ingredient.ingredient.unit.toUpperCase()})`,
+            }
         }
 
         Plotly.newPlot("itemUseGraph", [trace], layout);

+ 7 - 1
views/dashboardPage/js/analytics.js

@@ -101,7 +101,13 @@ let analytics = {
         }
 
         const layout = {
-            title: this.ingredient.ingredient.name
+            title: this.ingredient.ingredient.name,
+            xaxis: {
+                title: "DATE"
+            },
+            yaxis: {
+                title: `QUANTITY (${this.ingredient.ingredient.unit.toUpperCase()})`,
+            }
         }
 
         Plotly.newPlot("itemUseGraph", [trace], layout);