2025-05-13 15:03:09 +02:00

25 lines
675 B
JavaScript

export function generatePieTable(labels, series) {
let tableHTML = `
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Category</th>
<th>Count</th>
</tr>
</thead>
<tbody>
${labels
.map(
(label, i) => `
<tr>
<td>${label}</td>
<td>${series[i]}</td>
</tr>
`,
)
.join("")}
</tbody>
</table>`;
return tableHTML;
}