Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -227,14 +227,17 @@ def generate_pdf_report(dataframe, media_tempo_medio_turma, media_acertos_turma,
|
|
227 |
metrics = ['Tempo Médio (hh:mm:ss)', 'Média de Acertos (%)', 'Média de Tarefas']
|
228 |
values = [media_tempo_medio_turma, media_acertos_turma, media_tarefas_turma]
|
229 |
|
|
|
|
|
|
|
230 |
plt.figure(figsize=(10, 6))
|
231 |
-
bars = plt.bar(metrics,
|
232 |
plt.xlabel('Métricas')
|
233 |
plt.ylabel('Valores')
|
234 |
plt.title('Resumo da Turma')
|
235 |
plt.xticks(rotation=45, ha='right')
|
236 |
-
for bar, value in zip(bars,
|
237 |
-
plt.annotate(f'{value
|
238 |
xy=(bar.get_x() + bar.get_width() / 2, bar.get_height()),
|
239 |
xytext=(0, 3), # 3 points vertical offset
|
240 |
textcoords="offset points",
|
|
|
227 |
metrics = ['Tempo Médio (hh:mm:ss)', 'Média de Acertos (%)', 'Média de Tarefas']
|
228 |
values = [media_tempo_medio_turma, media_acertos_turma, media_tarefas_turma]
|
229 |
|
230 |
+
# Convertendo os valores para strings apropriadas
|
231 |
+
values_str = [media_tempo_medio_turma, f"{media_acertos_turma:.2f}", f"{media_tarefas_turma:.2f}"]
|
232 |
+
|
233 |
plt.figure(figsize=(10, 6))
|
234 |
+
bars = plt.bar(metrics, values_str, color=['blue', 'green', 'red'])
|
235 |
plt.xlabel('Métricas')
|
236 |
plt.ylabel('Valores')
|
237 |
plt.title('Resumo da Turma')
|
238 |
plt.xticks(rotation=45, ha='right')
|
239 |
+
for bar, value in zip(bars, values_str):
|
240 |
+
plt.annotate(f'{value}',
|
241 |
xy=(bar.get_x() + bar.get_width() / 2, bar.get_height()),
|
242 |
xytext=(0, 3), # 3 points vertical offset
|
243 |
textcoords="offset points",
|