Files
REG4_BDC_EVE/ReadingGroup.ipynb
2025-03-27 10:35:13 +01:00

120 KiB
Raw Permalink Blame History

In [32]:
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
In [33]:
# Excel-Datei einlesen
df = pd.read_excel("events.csv")  # Passe den Dateinamen an, falls nötig

df["Date"] = pd.to_datetime(df["Date"])  # Sicherstellen, dass Datum als Datetime erkannt wird
In [34]:
initial_hours = 50
df["Remaining Hours"] = initial_hours - df["Hours"].cumsum()

# Stil setzen
sns.set_style("darkgrid")
plt.figure(figsize=(14, 7))

# Farbverlauf für die Linie
colors = np.linspace(0.3, 1, len(df))  # Helligkeitsabstufung
for i in range(len(df) - 1):
    plt.plot(df["Date"].iloc[i:i+2], df["Remaining Hours"].iloc[i:i+2], 
             color=plt.cm.viridis(colors[i]), linewidth=3.5, linestyle="-")

# Markierungen mit Glow-Effekt
plt.scatter(df["Date"], df["Remaining Hours"], c=colors, cmap="viridis", s=150, 
            edgecolors="black", linewidth=2, alpha=0.9, zorder=3)

# Eventnamen leicht über den Punkten schwebend platzieren
for i, row in df.iterrows():
    plt.text(row["Date"], row["Remaining Hours"] + 1.5, row["Event"], fontsize=11, 
             ha='center', va='bottom', color='white', fontweight='bold', 
             bbox=dict(facecolor='black', alpha=0.5, boxstyle="round,pad=0.3"))

# Horizontale Linie bei 50 Stunden
plt.axhline(y=50, color='r', linestyle='--', linewidth=1.5, label='50 Stunden', alpha=0.8)

# Titel fancy gestalten
plt.title("🔥 Burndown Chart  Reading Group 📖", fontsize=18, fontweight="bold", 
          color='white', pad=15, loc='center', 
          bbox=dict(facecolor="black", alpha=0.8, boxstyle="round,pad=0.5"))

# Achsentitel & Styling
plt.xlabel("Datum", fontsize=12, fontweight="bold", color='white')
plt.ylabel("Verbleibende Stunden", fontsize=12, fontweight="bold", color='white')
plt.title("Burndown Chart  Reading Group", fontsize=18, fontweight="bold", 
          color='white', pad=15, loc='center', 
          bbox=dict(facecolor="black", alpha=0.8, boxstyle="round,pad=0.5"))


# Hintergrund & Achsen verschönern
plt.xticks(rotation=45, fontsize=11, color="white")
plt.yticks(range(0, 56, 5), fontsize=11, color="white")
plt.ylim(-2, 54)
plt.grid(True, linestyle='--', alpha=0.5, linewidth=0.7)

# Schwarzer Hintergrund für einen modernen Look
plt.gca().set_facecolor("#1e1e1e")
plt.gcf().patch.set_facecolor("#1e1e1e")

# Legende
plt.legend(frameon=True, fancybox=True, shadow=True, loc="upper right", fontsize=11)

# Anzeigen
plt.show()
No description has been provided for this image
In [ ]: