Hi,
I want to represent pairs of values in a polar chart (one of the values is the module or radius and the other one is the phase or angle).
I was suggested to use the Plotly charts. And before making my own chart, I am trying to reproduce some basic examples in which static values should be displayed.
Note that I do not have experience with HTML...
I don't see any result in the dashboard (I only see an empty box where the chart should be placed). So I need some help...
I copy the HTML code (with the JS script in it) in the Dashboard template node (which is assigned to a group into a Tab of the Dashboard). The code includes de values to be displayed, so I do not inject anything. But this does not display any result.
In a post of the forum, somone was using the moustache template (not the dashboard template but the core node). So I tried to paste the code into the moustache template, and inject it to the dashboard template.
I tried two ways, one is using the same link as the source
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script
and also I opened this js file and stored it into a folder, using the path as the source:
<script src="C:\Users\Ingenieria - Edu\.node-red\js_files\plotly-latest.min.js"></script>
So, what I copied in the Dashboard template node is:
<head>
<!-- Plotly.js -->
<script src="C:/Users/Ingenieria - Edu/.node-red/js_files/plotly-latest.min.js"></script>
</head>
<body>
<div id="myDiv"><!-- Plotly chart will be drawn inside this DIV --></div>
<script>
var trace1 = {
x:[1,2,3],//[{{payload.Temperature}}],
y:[1,2,3],//[{{payload.Temperature}}],
//mode: 'lines',
connectgaps: true
};
var data = [trace1];
var layout = {
title: 'Connect the Gaps Between Data',
showlegend: true
};
Plotly.newPlot('myDiv', data, layout, {showSendToCloud: true});
</script>
</body>
So... what am I doing bad? (as I said, I do not have experience with html, and only have the very basic knolwledge of javascript that one can get in an introductory online course)
Thanks