I have a line chart sample from D3, and the issue I'm facing is that I need to continuously feed live data from a server at certain time intervals and use D3 to draw the chart based on this dynamic data. Despite my efforts to search for a solution, I haven't been able to find any examples that directly address this. I've attempted some AJAX coding as shown below, but it's not working as intended. Could you please assist me with this challenge? Here is the code snippet:
<html>
<head>
<script src="../D3/d3.min.js"></script>
<script>
// Code omitted for brevity
</script>
</head>
<body>
<button type="button" onclick="loaddata()">GET DATA</button>
<div id="demo"></div>
<style>
body {
font-family: Verdana, sans-serif;
font-size: 8pt;
line-height: 12pt;
background: #ffffff;
color: #555555;
}
.axis path, .axis line {
fill: none;
stroke: green;
shape-rendering: crispEdges;
}
.line {
fill: none;
stroke: red;
stroke-width: 1px;
}
</style>
</body>
</html>