Pi 10 달 전
부모
커밋
9481ca17cb
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      app/rest/static/manifest.json
  2. 3 3
      app/rest/trend.py

+ 1 - 1
app/rest/static/manifest.json

@@ -1,6 +1,6 @@
 {
   "id": "/grocery",
-  "name": "Grocery Manager Web Application",
+  "name": "Grocery Manager",
   "short_name": "Grocery",
   "description": "View trending price data and tracked product info",
   "start_url": "/grocery/trend",

+ 3 - 3
app/rest/trend.py

@@ -37,7 +37,7 @@ matplotlib.use('agg')
 plot_style = {
     "lines.color": "#ffffff",
     "patch.edgecolor": "#ffffff",
-    "text.color": "#ffffff",
+    "text.color": "#000000",
     "axes.facecolor": "#7f7f7f",
     "axes.edgecolor": "#ffffff",
     "axes.labelcolor": "#ffffff",
@@ -199,7 +199,7 @@ def volume_internal(conn: Connection[TupleRow], path: str, query: FormsDict):
                 group = _g
                 break
 
-            pivot = data.groupby([group,])[['price', 'quantity']].sum()
+            pivot = data[~(data['quantity'].isnull())].groupby([group,])[['price', 'quantity']].sum()
             
             if pivot.empty:
                 abort(404, f"No data.")
@@ -209,7 +209,7 @@ def volume_internal(conn: Connection[TupleRow], path: str, query: FormsDict):
             plt.rcParams.update(plot_style)
             plt.rcParams.update({"grid.linewidth":0.2, "grid.alpha":0.5})
             plt.figure(figsize=[16, 9], layout="tight")
-            axes = pivot.plot.pie(subplots=True, figsize=(11, 5))
+            axes = pivot.plot.pie(subplots=True, figsize=(11, 5), labeldistance=1.1, autopct='%.0f', pctdistance=0.8, rotatelabels=False)
 
             for ax, title in zip(axes, (
                 f'Expenditure ($)',