feat(chart): The size of the chart now increases every 5 dates in the list
Some checks failed
Create and publish a Docker image / build-and-push-server (push) Has been cancelled
Create and publish a Docker image / build-and-push-chart (push) Has been cancelled
Create and publish a Docker image / build-and-push-CR (push) Has been cancelled
Deploy docs / deploy (push) Has been cancelled

This commit is contained in:
Данил 2025-01-05 00:34:44 +03:00
parent bc1e05f575
commit d3f9652d8a

View file

@ -55,10 +55,14 @@ async def create_chart(
return None
date, rate = [], []
fig = plt.gcf()
for row in data:
date.append(str(row['date']))
rate.append(row['rate'])
width = 18.5 + (len(date) // 5) * 2
fig.set_size_inches(width, 9.5)
if rate[0] < rate[-1]:
plt.plot(date, rate, color='green', marker='o')
@ -70,8 +74,6 @@ async def create_chart(
plt.xlabel('Date')
plt.ylabel('Rate')
fig = plt.gcf()
fig.set_size_inches(18.5, 9.5)
name = await generate_unique_name(
f'{from_currency.upper()}_{conv_currency.upper()}',