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

github.com/VVelox/hugo-dusky-neon-potato.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZane C. Bowers-Hadley <vvelox@vvelox.net>2018-09-23 01:39:25 +0300
committerZane C. Bowers-Hadley <vvelox@vvelox.net>2018-09-23 01:39:25 +0300
commit9b06da7aaa66a6691f5a2a182a3d4d00257888e8 (patch)
tree05376d9dad19977786195173b749343bf5c618ce
parent203288c6f4ecfd1f4eafff04250d6502c8097600 (diff)
basic chart generation should now work
-rw-r--r--layouts/shortcodes/chart-generate.html31
1 files changed, 28 insertions, 3 deletions
diff --git a/layouts/shortcodes/chart-generate.html b/layouts/shortcodes/chart-generate.html
index b6d6850..d6d7746 100644
--- a/layouts/shortcodes/chart-generate.html
+++ b/layouts/shortcodes/chart-generate.html
@@ -1,6 +1,31 @@
-<div>
+<script>
var chart = c3.generate({
bindto: '{{ .Get "chart" }}',
+ data: {
+ {{ with .x }}
+ x: '{{.}}',
+ {{ end }}
+ url: '{{ .Get "url" }}',
+ type: '{{ .Get "type" }}'
+ }
+ {{ if (or ( isset .x-label )(or ( isset .y-label )( .y2-label ))) }}
+ ,axis: {
+ {{ with .x-label }}
+ x: {
+ label: '{{.}}'
+ }
+ {{ end }}
+ {{ if isset .y-label }},{{end}}
+ {{ with .y-label }}
+ x: {
+ label: '{{.}}'
+ }
+ {{ if isset .y2-label }},{{end}}
+ {{ with .y2-label }}
+ x: {
+ label: '{{.}}'
+ }
+ }
+ {{ end }}
});
-</div>
-
+</script>