// SVG Bar Chart
import { escapeHtml } from "../../core/helpers";
import type { DailyCount } from "../../types/api";
export function renderSVGBarChart(dailyCounts: DailyCount[]): string {
if (!dailyCounts || dailyCounts.length === 0) return "";
const chartW = 700;
const chartH = 100;
const barGap = 4;
const barW = Math.max(
8,
(chartW - (dailyCounts.length - 1) * barGap) / dailyCounts.length,
);
let maxCount = 0;
for (const day of dailyCounts) {
const total = (day.completed || 0) + (day.failed || 0);
if (total > maxCount) maxCount = total;
}
if (maxCount === 0) maxCount = 1;
let svg = `";
return svg;
}