You can use Chart.js library to create an x y graph in JavaScript. Here's a script that generates a new point every time the script runs and adds it to the existing chart:
index.tsx562 chars32 lines
Here, we have initialized a chart using Chart.js library, added an empty dataset, and set the options as required. We generated random x,y values and added them to the dataset of the chart. The last line tells the chart to update with the new data.
Note: You need to include the Chart.js script tag in your HTML file.
gistlibby LogSnag