Added graph

This commit is contained in:
2024-03-29 16:16:08 +01:00
parent 7a35c54322
commit 26b35036ec
3 changed files with 12 additions and 1 deletions

View File

@@ -24,7 +24,9 @@ class GaugeGroup {
</div>
</div>
`).join('')}
<div id="graph${nodeId}></div>
</div>
<div class="plotly-container">
<div id="liveGraph${this.nodeId}" ></div>
</div>
`;

View File

@@ -27,6 +27,7 @@
<body>
<script src="https://cdn.plot.ly/plotly-latest.min.js" charset="utf-8"></script>
<script src="GaugGroup.js"></script>
<script src="main.js"></script>
<script src="liveGraph.js"></script>

View File

@@ -98,9 +98,17 @@ async function nodeAdressHandler(node, dataTypes) {
let gaugeGroup = new GaugeGroup(nodeName, nodeLocation, dataTypes.length, maxGaugeValues, dataTypes);
sensorData[node] = gaugeGroup;
gaugeGroup.graph = new liveGraph(nodeName);
sensorData[node] = gaugeGroup;
gaugeGroup.graph.makeGraph();
sensorData[node] = gaugeGroup;
}
}
function getNodeInfo(node){
return fetch("http://145.92.8.114/getNodeInfo?macAdress=" + node)
.then(response => {