import base64
import io
import matplotlib.pyplot as plt
weekly_sales = [82, 88, 91, 87, 95, 101, 108]
current, previous = weekly_sales[-1], weekly_sales[-2]
change_pct = (current - previous) / previous * 100
color = "bg-green" if change_pct >= 0 else "bg-red"
delta = f"{change_pct:+.1f}%"
fig, ax = plt.subplots(figsize=(10, 0.6))