Explorar o código

Add axis labels to graph

Lee Morgan %!s(int64=5) %!d(string=hai) anos
pai
achega
2e6102b1a1
Modificáronse 2 ficheiros con 14 adicións e 2 borrados
  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);