2019-02-23 06:29:19 +00:00
|
|
|
|
|
|
|
<script>
|
|
|
|
let rawLabels = [{{range .Graph.Labels}}
|
|
|
|
{{.}},{{end}}
|
|
|
|
];
|
|
|
|
let seriesData = [{{range .Graph.Series}}[{{range .}}
|
|
|
|
{{.}},{{end}}
|
|
|
|
],{{end}}
|
|
|
|
];
|
|
|
|
let legendNames = [{{range .Graph.Legends}}
|
|
|
|
{{.}},{{end}}
|
|
|
|
];
|
2019-03-03 03:19:32 +00:00
|
|
|
addInitHook("after_phrases", () => {
|
2019-03-21 22:59:41 +00:00
|
|
|
addInitHook("end_init", () => {
|
|
|
|
addInitHook("analytics_loaded", () => {
|
2019-05-08 05:26:38 +00:00
|
|
|
if("{{.TimeRange}}" != "one-week" && seriesData.length > 0 && seriesData[0].length > 12) {
|
|
|
|
let elem = document.getElementsByClassName("colstack_graph_holder")[0];
|
|
|
|
let w = elem.clientWidth;
|
|
|
|
console.log("w:",w);
|
|
|
|
elem.classList.add("scrolly");
|
|
|
|
console.log("elem.clientWidth:",elem.clientWidth);
|
|
|
|
elem.setAttribute("style","width:"+w+"px;");
|
|
|
|
console.log("elem.clientWidth:",elem.clientWidth);
|
|
|
|
}
|
2019-03-21 22:59:41 +00:00
|
|
|
buildStatsChart(rawLabels, seriesData, "{{.TimeRange}}",legendNames);
|
|
|
|
});
|
|
|
|
});
|
2019-03-03 03:19:32 +00:00
|
|
|
});
|
2019-02-23 06:29:19 +00:00
|
|
|
</script>
|