(audit, ax)
| 457 | |
| 458 | |
| 459 | def chart_2_failure_dist(audit, ax): |
| 460 | dist = audit.failure_distribution() |
| 461 | dist.pop("none", None) |
| 462 | if not dist: |
| 463 | ax.text(0.5, 0.5, "No failures recorded", ha="center", va="center", |
| 464 | transform=ax.transAxes, fontsize=10) |
| 465 | ax.set_title("Failure Mode Distribution", fontsize=11, fontweight="bold", |
| 466 | color=CHART_COLOR_DARK) |
| 467 | return |
| 468 | labels = [k.replace("_", "\n") for k in dist.keys()] |
| 469 | values = list(dist.values()) |
| 470 | palette = [CHART_COLOR_FAIL, CHART_COLOR_ACCENT, CHART_COLOR_NEUTRAL, "#E9C46A", "#F4A261"] |
| 471 | bars = ax.barh(labels, values, color=palette[:len(labels)], edgecolor="white", linewidth=1.2) |
| 472 | for bar, val in zip(bars, values): |
| 473 | ax.text(bar.get_width() + 0.05, bar.get_y() + bar.get_height() / 2, |
| 474 | str(val), va="center", ha="left", fontsize=9, |
| 475 | color=CHART_COLOR_DARK, fontweight="bold") |
| 476 | _apply_base_style(ax, "Failure Mode Distribution (All Attempts)", "Count", "") |
| 477 | ax.yaxis.grid(False) |
| 478 | ax.xaxis.grid(True, color=CHART_GRID, linewidth=0.8, linestyle="--") |
| 479 | |
| 480 | |
| 481 | def chart_3_retry_dist(attempts_dist, ax): |
no test coverage detected