|
@@ -161,7 +161,7 @@ async def get_trend_image(kw):
|
|
plt.gca().xaxis.set_major_locator(mdates.DayLocator(interval=3)) #座標軸刻度1天
|
|
plt.gca().xaxis.set_major_locator(mdates.DayLocator(interval=3)) #座標軸刻度1天
|
|
|
|
|
|
target_path = 'trend_image/'+kw+".png"
|
|
target_path = 'trend_image/'+kw+".png"
|
|
- plt.plot(x, y,'r-^') # 設定樣式
|
|
|
|
|
|
+ plt.plot(x_axis, y_axis,'r-^') # 設定樣式
|
|
plt.savefig(target_path, bbox_inches='tight') #存檔,第二個參數表示把圖表外多餘的空間刪除
|
|
plt.savefig(target_path, bbox_inches='tight') #存檔,第二個參數表示把圖表外多餘的空間刪除
|
|
|
|
|
|
return FileResponse(target_path)
|
|
return FileResponse(target_path)
|