Przeglądaj źródła

下载前5名, 画图亏损涂绿

xjc 7 miesięcy temu
rodzic
commit
8949b7812a
2 zmienionych plików z 3 dodań i 2 usunięć
  1. 1 1
      src/manage/controls.py
  2. 2 1
      src/utils/plottool.py

+ 1 - 1
src/manage/controls.py

@@ -1394,7 +1394,7 @@ def download_top3_imgs(request):
     imgData = []
     for group_id in group_ids:
         data = list(qset.filter(match_group=group_id).order_by("group_rank").values())
-        for item in data[:3]:
+        for item in data[:5]:
             today_stock_img = json.loads(item["today_stock_img"]) if item["today_stock_img"] else []
             ilist = []
             for img in today_stock_img:

+ 2 - 1
src/utils/plottool.py

@@ -85,7 +85,8 @@ def plot_records_as_table_and_convert_to_png(
             table[i + offset, j].set_fontsize(14)
             if not table_data[i][5].startswith('-'):
                 table[i + offset, j].get_text().set_color('red')
-            
+        if table_data[i][4].startswith('-'):
+            table[i + offset, 4].get_text().set_color('green')
 
     ax.add_table(table)
     if localfile: