mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 20:51:25 +03:00
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
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:
parent
bc1e05f575
commit
d3f9652d8a
1 changed files with 4 additions and 2 deletions
|
@ -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()}',
|
||||
|
|
Loading…
Add table
Reference in a new issue