|
@@ -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 ($)',
|