Format
This commit is contained in:
parent
014217604c
commit
092a1d7417
21
wsgi.py
21
wsgi.py
@ -72,8 +72,7 @@ def create_plot_df(
|
|||||||
df.index = df.index.astype("datetime64[ns]") + pd.DateOffset(hours=10)
|
df.index = df.index.astype("datetime64[ns]") + pd.DateOffset(hours=10)
|
||||||
|
|
||||||
df = df.reindex(
|
df = df.reindex(
|
||||||
pd.date_range(start="2023-08-15", end=curr_datetime)
|
pd.date_range(start="2023-08-15", end=curr_datetime) + pd.DateOffset(hours=10)
|
||||||
+ pd.DateOffset(hours=10)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if current_df is not None:
|
if current_df is not None:
|
||||||
@ -89,13 +88,14 @@ def create_plot_df(
|
|||||||
|
|
||||||
return df
|
return df
|
||||||
|
|
||||||
|
|
||||||
def plot(
|
def plot(
|
||||||
current_df: pd.DataFrame | None = None,
|
current_df: pd.DataFrame | None = None,
|
||||||
data_folder: str = "data",
|
data_folder: str = "data",
|
||||||
sheet_name: str = "digital",
|
sheet_name: str = "digital",
|
||||||
total_targets: tuple[int, ...] = (1500, ),
|
total_targets: tuple[int, ...] = (1500,),
|
||||||
alpha: float | None = None,
|
alpha: float | None = None,
|
||||||
landesbez_str: str | None = None
|
landesbez_str: str | None = None,
|
||||||
) -> str:
|
) -> str:
|
||||||
curr_datetime = datetime.datetime.now()
|
curr_datetime = datetime.datetime.now()
|
||||||
df = create_plot_df(
|
df = create_plot_df(
|
||||||
@ -140,12 +140,21 @@ def plot(
|
|||||||
if current_df is not None:
|
if current_df is not None:
|
||||||
plt.annotate(
|
plt.annotate(
|
||||||
"Jetzt",
|
"Jetzt",
|
||||||
(plot_df.dropna().index[-1], plot_df.dropna()["Digitale Befragung"][-1] * 1.03),
|
(
|
||||||
|
plot_df.dropna().index[-1],
|
||||||
|
plot_df.dropna()["Digitale Befragung"][-1] * 1.03,
|
||||||
|
),
|
||||||
fontsize=8,
|
fontsize=8,
|
||||||
ha="center",
|
ha="center",
|
||||||
)
|
)
|
||||||
|
|
||||||
plt.plot(plot_df.index, plot_df["Digitale Befragung"], lw=1.5, color="#e4004e", label=landesbez_str,)
|
plt.plot(
|
||||||
|
plot_df.index,
|
||||||
|
plot_df["Digitale Befragung"],
|
||||||
|
lw=1.5,
|
||||||
|
color="#e4004e",
|
||||||
|
label=landesbez_str,
|
||||||
|
)
|
||||||
|
|
||||||
plt.title("Teilnahme an Digitaler Beschäftigtenbefragung")
|
plt.title("Teilnahme an Digitaler Beschäftigtenbefragung")
|
||||||
plt.ylabel("# Teilnahmen")
|
plt.ylabel("# Teilnahmen")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user