chore(chart): I made the hyphenation because of the big line.

This commit is contained in:
Данил 2025-02-19 12:59:56 +03:00
parent 2c28db0eb6
commit 5407830125

View file

@ -46,7 +46,8 @@ async def create_chart(
async with pool.acquire() as conn: async with pool.acquire() as conn:
data = await conn.fetch( data = await conn.fetch(
'SELECT date, rate FROM currency ' 'SELECT date, rate FROM currency '
'WHERE (date BETWEEN $1 AND $2) AND from_currency = $3 AND conv_currency = $4 ORDER BY date', 'WHERE (date BETWEEN $1 AND $2) ' +
'AND from_currency = $3 AND conv_currency = $4 ORDER BY date',
start_date_obj, start_date_obj,
end_date_obj, end_date_obj,
from_currency.upper(), from_currency.upper(),
@ -74,7 +75,12 @@ async def create_chart(
label.set_fontsize(10) label.set_fontsize(10)
ax.set_xtick(np.linspace(0, len(date) - 1, 10)) ax.set_xtick(np.linspace(0, len(date) - 1, 10))
ax.set_xticklabels([date[int(i)].strftime('%Y-%m-%d') for i in np.linspace(0, len(date) - 1, 10).astype(int)]) ax.set_xticklabels(
[
date[int(i)].strftime('%Y-%m-%d')
for i in np.linspace(0, len(date) - 1, 10).astype(int)
]
)
name = await generate_unique_name( name = await generate_unique_name(
f'{from_currency.upper()}_{conv_currency.upper()}', f'{from_currency.upper()}_{conv_currency.upper()}',