3๐
I was not able to get my desired result using chart.js however I found a two way to create a live streaming ecg graph.
1.) smoothiecharts โ http://smoothiecharts.org/ โ very nice and simple for making live streaming charts however did not have the customizeability i needed to achieve my desired results.
2.) http://theblogofpeterchen.blogspot.com/2015/02/html5-high-performance-real-time.html โ I found a blog where someone made a live ecg without using any charting libraries, instead they wrote there own constructor for making live graphs using requestAnimationFrame() to make it work. This is what I used. Now i just need to learn how to vary the heart rate haha.
0๐
This webcomponent has amazing api. All you need to do is run callback when next beat is appear
document.body.innerHTML += '<ecg-line></ecg-line>';
ecgLine((bang) => setInterval(() => bang(), 1000));