viz: format x-axis ticks with full date (YYYY-MM-DD)
All checks were successful
Generate banlist history graph / build (push) Successful in 6s

This commit is contained in:
codex-bot 2025-08-26 23:16:28 -05:00
commit 2cc881199f

View file

@ -112,10 +112,10 @@ def write_chart(snaps: List[Snapshot], image_path: str) -> None:
ax.set_ylabel("IP count") ax.set_ylabel("IP count")
ax.grid(True, linestyle=":", linewidth=0.5) ax.grid(True, linestyle=":", linewidth=0.5)
# Reduce x-axis label crowding; keep ticks but rotate labels for readability # Use full date labels on major ticks
try: try:
locator = mdates.AutoDateLocator(minticks=4, maxticks=8) locator = mdates.AutoDateLocator(minticks=4, maxticks=8)
formatter = mdates.ConciseDateFormatter(locator) formatter = mdates.DateFormatter('%Y-%m-%d')
ax.xaxis.set_major_locator(locator) ax.xaxis.set_major_locator(locator)
ax.xaxis.set_major_formatter(formatter) ax.xaxis.set_major_formatter(formatter)
except Exception: except Exception: