File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,9 +166,10 @@ def generate_price_chart(
166166 elif hours <= 168 :
167167 ax .xaxis .set_major_formatter (mdates .DateFormatter ("%b %d %H:%M" ))
168168 ax .xaxis .set_major_locator (mdates .DayLocator (interval = 1 ))
169+ ax .xaxis .set_minor_locator (mdates .HourLocator (interval = 6 ))
169170 else :
170171 ax .xaxis .set_major_formatter (mdates .DateFormatter ("%b %d" ))
171- ax .xaxis .set_major_locator (mdates .WeekdayLocator ( byweekday = 0 ))
172+ ax .xaxis .set_major_locator (mdates .MonthLocator ( ))
172173
173174 price_min = min (prices_arr )
174175 price_max = max (prices_arr )
@@ -215,7 +216,9 @@ async def get_chart_bytes(
215216 ) -> Optional [bytes ]:
216217 """Get price history from DB and generate chart."""
217218 max_points = 800 if hours <= 24 else 1200 if hours <= 168 else 1500
218- history = await db .get_price_history (crypto , hours = hours , descending = True )
219+ history = await db .get_price_history (
220+ crypto , hours = hours , limit = None , descending = True
221+ )
219222
220223 if not history or len (history ) < 2 :
221224 return None
You can’t perform that action at this time.
0 commit comments