From 77aaddb119459ae78a62eb540df4c20f86568acb Mon Sep 17 00:00:00 2001 From: Redume Date: Wed, 19 Feb 2025 14:19:18 +0300 Subject: [PATCH] feat(chart): Made colors for rising, falling and stagnant rates --- chart/function/create_chart.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chart/function/create_chart.py b/chart/function/create_chart.py index 74cede3..ef866fa 100644 --- a/chart/function/create_chart.py +++ b/chart/function/create_chart.py @@ -87,7 +87,13 @@ async def create_chart( ) - plt.plot(newx_2, newy_2) + if rate[0] < rate[-1]: + plt.plot(newx_2, newy_2, color='green') + elif rate[0] > rate[-1]: + plt.plot(newx_2, newy_2, color='red', marker='o') + else: + plt.plot(newx_2, newy_2, color='grey') + plt.savefig(f'../charts/{name}.png') fig.clear()