Code based on https://canvasjs.com/docs/charts/intro/high-performance-javascript-charts/ https://canvasjs.com/javascript-charts/performance-demo-chart/