Here is the link to the code I would like to combine (includes CSS, Javascript, HTML separately): http://jsfiddle.net/4tjv85zh/3/
Below is my attempt to combine it all into one HTML file. It was, unfortunately, unsuccessful, but I'm not sure why.
<!DOCTYPE html>
<html>
<body>
<canvas id="chart" width="500" height="250">
<script src="http://smoothiecharts.org/smoothie.js">
var chart = new SmoothieChart({
grid: {
fillStyle: '#ffffff'
},
labels: {
fillStyle: '#000000'
},
tooltip: true,
timestampFormatter: SmoothieChart.timeFormatter
}),
timeSeries = new TimeSeries();
chart.addTimeSeries(timeSeries, {
strokeStyle: 'blue',
lineWidth: 1,
fillStyle: 'rgba(0,128,255,0.30)'
});
chart.streamTo(document.getElementById('chart'), 100);
setInterval(function() {
timeSeries.append(new Date().getTime(), Math.random() * 100);
}, 1000);
</script>
<style>
div.smoothie-chart-tooltip {
background: #999;
padding: 1em;
margin-top: 20px;
font-family: consolas;
color: white;
font-size: 17px;
pointer-events: none;
}
</canvas>
</body>
</html>
script
tag that includes asrc
requires that it be immediately followed by a closing tag. Any code afterwards needs to wrapped in an additionalscript
tag. a.e.<script src="lib.js"></script><script> ....other code </script>
– zfrisch Jul 30 '18 at 18:19