diff options
author | Zane C. Bowers-Hadley <vvelox@vvelox.net> | 2018-09-23 01:39:25 +0300 |
---|---|---|
committer | Zane C. Bowers-Hadley <vvelox@vvelox.net> | 2018-09-23 01:39:25 +0300 |
commit | 9b06da7aaa66a6691f5a2a182a3d4d00257888e8 (patch) | |
tree | 05376d9dad19977786195173b749343bf5c618ce | |
parent | 203288c6f4ecfd1f4eafff04250d6502c8097600 (diff) |
basic chart generation should now work
-rw-r--r-- | layouts/shortcodes/chart-generate.html | 31 |
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> |