-
Notifications
You must be signed in to change notification settings - Fork 4
/
timeseries_js_qtpl.go
132 lines (124 loc) · 3.1 KB
/
timeseries_js_qtpl.go
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// This file is automatically generated by qtc from "timeseries_js.qtpl".
// See https://github.com/valyala/quicktemplate for details.
//line timeseries_js.qtpl:1
package c3
//line timeseries_js.qtpl:1
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line timeseries_js.qtpl:1
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line timeseries_js.qtpl:1
func StreamTimeseriesHTML(qw422016 *qt422016.Writer, data TimeseriesData) {
//line timeseries_js.qtpl:1
qw422016.N().S(`
`)
//line timeseries_js.qtpl:2
if data.IncludeTitle {
//line timeseries_js.qtpl:2
qw422016.N().S(`
<`)
//line timeseries_js.qtpl:3
qw422016.N().S(data.TitleLevel)
//line timeseries_js.qtpl:3
qw422016.N().S(`>`)
//line timeseries_js.qtpl:3
qw422016.N().S(data.Title)
//line timeseries_js.qtpl:3
qw422016.N().S(`</`)
//line timeseries_js.qtpl:3
qw422016.N().S(data.TitleLevel)
//line timeseries_js.qtpl:3
qw422016.N().S(`>
`)
//line timeseries_js.qtpl:4
}
//line timeseries_js.qtpl:4
qw422016.N().S(`
<div class='c3-editor' id='`)
//line timeseries_js.qtpl:5
qw422016.N().S(data.DivID)
//line timeseries_js.qtpl:5
qw422016.N().S(`'></div>
<script>
var `)
//line timeseries_js.qtpl:8
qw422016.N().S(data.JSDataVar)
//line timeseries_js.qtpl:8
qw422016.N().S(` = `)
//line timeseries_js.qtpl:8
qw422016.N().Z(data.JSONData.JSON())
//line timeseries_js.qtpl:8
qw422016.N().S(`
var `)
//line timeseries_js.qtpl:9
qw422016.N().S(data.JSChartVar)
//line timeseries_js.qtpl:9
qw422016.N().S(` = c3.generate({
bindto: '#`)
//line timeseries_js.qtpl:10
qw422016.N().S(data.DivID)
//line timeseries_js.qtpl:10
qw422016.N().S(`',
data: {
x: 'x',
columns: `)
//line timeseries_js.qtpl:13
qw422016.N().S(data.JSDataVar)
//line timeseries_js.qtpl:13
qw422016.N().S(`.columns
},
axis: {
x: {
type: 'timeseries',
tick: {
format: '%Y-%m'
}
}
},
/*
tooltip: {
format: {
title: function (d) {
var iso8601ym = JSON.stringify(d).substr(1,7)
return iso8601ym + ' ' + `)
//line timeseries_js.qtpl:28
qw422016.N().S(data.JSDataVar)
//line timeseries_js.qtpl:28
qw422016.N().S(`.totalsMap[iso8601ym]
}
}
}*/
});
</script>
`)
//line timeseries_js.qtpl:34
}
//line timeseries_js.qtpl:34
func WriteTimeseriesHTML(qq422016 qtio422016.Writer, data TimeseriesData) {
//line timeseries_js.qtpl:34
qw422016 := qt422016.AcquireWriter(qq422016)
//line timeseries_js.qtpl:34
StreamTimeseriesHTML(qw422016, data)
//line timeseries_js.qtpl:34
qt422016.ReleaseWriter(qw422016)
//line timeseries_js.qtpl:34
}
//line timeseries_js.qtpl:34
func TimeseriesHTML(data TimeseriesData) string {
//line timeseries_js.qtpl:34
qb422016 := qt422016.AcquireByteBuffer()
//line timeseries_js.qtpl:34
WriteTimeseriesHTML(qb422016, data)
//line timeseries_js.qtpl:34
qs422016 := string(qb422016.B)
//line timeseries_js.qtpl:34
qt422016.ReleaseByteBuffer(qb422016)
//line timeseries_js.qtpl:34
return qs422016
//line timeseries_js.qtpl:34
}