link to graphs
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
{{define "body_content"}}
|
||||
{{ if ne .UserName "" }}
|
||||
|
||||
<div>
|
||||
<section id="chart">
|
||||
<!-- Content ... -->
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
|
||||
<script>
|
||||
|
||||
var sPageURL = window.location.search.substring(1);
|
||||
|
||||
$.getJSON('https://mini-beieli.ch/metrics?' + sPageURL, function(mydata) {
|
||||
var options = {
|
||||
chart: {
|
||||
type: 'line',
|
||||
animations: {
|
||||
enabled: false
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
type: "datetime"
|
||||
},
|
||||
tooltip: {
|
||||
x: {
|
||||
format: 'dd.MM.yyyy HH:mm'
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: 'Temperatur',
|
||||
data: mydata
|
||||
}]
|
||||
}
|
||||
|
||||
var chart = new ApexCharts(document.querySelector("#chart"), options);
|
||||
|
||||
chart.render();
|
||||
});
|
||||
</script>
|
||||
|
||||
{{ else }}
|
||||
<h4>Bitte zuerst <a href="login.html">einloggen</a></h4>
|
||||
{{end}}
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user