Graph CSS fixes

This commit is contained in:
Magnus Åhall 2024-06-27 09:14:02 +02:00
parent 617e025be4
commit 4b21b0ac07
4 changed files with 18 additions and 9 deletions

View File

@ -69,6 +69,8 @@
} }
.graph { .graph {
width: 99%; width: 99%;
height: 600px; border: 1px solid #aaa;
border: 1px solid #fff; }
.graph #graph-values {
height: 600px;
} }

View File

@ -69,6 +69,8 @@
} }
.graph { .graph {
width: 99%; width: 99%;
height: 600px; border: 1px solid #aaa;
border: 1px solid #fff; }
.graph #graph-values {
height: 600px;
} }

View File

@ -84,6 +84,9 @@
.graph { .graph {
width: 99%; width: 99%;
height: 600px; border: 1px solid #aaa;
border: 1px solid #fff;
#graph-values {
height: 600px;
}
} }

View File

@ -21,14 +21,16 @@
<br><br> <br><br>
{{ if $graph }} {{ if $graph }}
<div class="graph" id="tester"></div> <div class="graph">
<div id="graph-values"></div>
</div>
<script type="text/javascript"> <script type="text/javascript">
const tester = document.getElementById('tester'); const graphValues = document.getElementById('graph-values');
let data = {{ .Data }} let data = {{ .Data }}
let x = data.Values.map(d => d.Ts) let x = data.Values.map(d => d.Ts)
let y = data.Values.map(d => d.ValueInt.Int64) let y = data.Values.map(d => d.ValueInt.Int64)
Plotly.newPlot( Plotly.newPlot(
tester, graphValues,
[ [
{ {
x, x,