1
0
mirror of https://github.com/nikolaydubina/calendarheatmap.git synced 2024-12-12 13:25:21 +02:00
calendarheatmap/charts/template.svg

17 lines
1018 B
XML
Raw Permalink Normal View History

<svg viewBox="0 0 {{$.BoxAreaWidth}} {{$.BoxAreaHeight}}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink= "http://www.w3.org/1999/xlink">
<g transform="translate(25, 23)">
{{range $w, $wo := $.Days}}<g transform="translate({{mul (add $.BoxSize $.Margin) $w}}, 0)">
{{range $d, $do := $wo}}{{if $do.Show}}<rect class="day" width="{{$.BoxSize}}" height="{{$.BoxSize}}" x="0" y="{{mul (add $.BoxSize $.Margin) $d}}" fill="{{$do.Color}}" data-count="{{$do.Count}}" data-date="{{$do.Date}}"></rect>{{end}}
2020-12-07 13:55:29 +02:00
{{end}}
</g>
{{end}}
2021-02-27 19:21:46 +02:00
{{range $i, $label := $.LabelsMonths}}<text x="{{mul (add $.BoxSize $.Margin) $label.XOffset}}" y="-7" font-size="10" fill="{{$.LabelsColor}}">{{$label.Label}}</text>
2020-12-07 13:55:29 +02:00
{{end}}
{{range $i, $o := $.LabelsWeekdays}}<text text-anchor="start" font-size="10" dx="-25" dy="{{add 15 (mul (add $.BoxSize $.Margin) $i)}}" fill="{{$.LabelsColor}}" {{if not $o.Show}}style="display: none;"{{end}}>{{$o.Label}}</text>
{{end}}
{{range $i, $l := $.MonthSeparators}}{{$l}}
2020-12-07 13:55:29 +02:00
{{end}}
2021-08-10 12:42:20 +02:00
</g></svg>