Files
motr/internal/ui/charts/bar_chart.templ

22 lines
460 B
Plaintext

package charts
import "fmt"
type KeyValue struct {
Key string
Value int
Color string
}
templ BarChart(data []KeyValue) {
for _, d := range data {
<div class="flex flex-col">
<div class="flex justify-between">
<span class="text-sm font-medium text-gray-900">${ d.Key }</span>
<span class="text-sm font-medium text-gray-900">${ fmt.Sprintf("%d", d.Value) }</span>
</div>
<div class="h-1 bg-gray-200 rounded-full"></div>
</div>
}
}