github.com/Azareal/Gosora@v0.0.0-20210729070923-553e66b59003/templates/panel_analytics_script.html (about)

     1  
     2  <script>
     3  let rawLabels = [{{range .Graph.Labels}}
     4  {{.}},{{end}}
     5  ];
     6  let seriesData = [{{range .Graph.Series}}[{{range .}}
     7  {{.}},{{end}}
     8  ],{{end}}
     9  ];
    10  let legendNames = [{{range .Graph.Legends}}
    11  {{.}},{{end}}
    12  ];
    13  addInitHook("after_phrases", () => {
    14  	addInitHook("end_init", () => {
    15  		addInitHook("analytics_loaded", () => {
    16  			buildStatsChart(rawLabels,seriesData,"{{.TimeRange}}",legendNames);
    17  		});
    18  	});
    19  });
    20  </script>