Welcome to mirror list, hosted at ThFree Co, Russian Federation.

chart-generate.html « shortcodes « layouts - github.com/VVelox/hugo-dusky-neon-potato.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dcd4f5448814b30cec6ca0124099185dd614f9d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script>
var chart = c3.generate({
    bindto: '#{{ .Get "chart" }}',
    data: {
        {{ with .Get "x" }}
         x: '{{.}}',
        {{ end }}
        url: '{{ .Get "url" }}',
        type: '{{ .Get "type" }}'
    }
    {{ if or (isset .Params "xLabel") (or (isset .Params "yLabel") (isset .Params "y2Label") ) }}
     ,axis: {
         {{ with .Get "xLabel" }}
          x: {
              label: '{{.}}'
          }
         {{ end }}
         {{ if isset .Params "yLabel" }},{{end}}
         {{ with .Get "yLabel" }}
          y: {
              label: '{{.}}'
          }
         {{ end }}
         {{ if isset .Params "y2Label" }},{{end}}
         {{ with .Get "y2Label" }}
          y2: {
              show: true,
              label: '{{.}}'
          }
          {{ end }}
     }
    {{ end }}
});
</script>