From 313eb489abb5862353baa97ec6809b2c4b6a2f09 Mon Sep 17 00:00:00 2001 From: WebMoneyMaker <103347453+LetsWorkAround@users.noreply.github.com> Date: Wed, 21 Aug 2024 18:16:33 +0900 Subject: [PATCH] Update index.html --- index.html | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 8b1a840..f375936 100644 --- a/index.html +++ b/index.html @@ -486,7 +486,7 @@

레드판다스컴퍼니 주식회사 (Red Pandas Company)

} }; - setInterval(draw, 100); + setInterval(draw, 200); // 화면 크기 변경 시 캔버스 크기 조정 window.addEventListener('resize', () => { @@ -501,7 +501,7 @@

레드판다스컴퍼니 주식회사 (Red Pandas Company)

(function() { const canvas = document.getElementById('fund-performance-graph'); const ctx = canvas.getContext('2d'); - const lastUpdateTime = 0; + let width, height; const dataPoints = 60; const funds = ['Fund A', 'Fund B', 'Fund C']; @@ -571,19 +571,16 @@

레드판다스컴퍼니 주식회사 (Red Pandas Company)

}); } - const updateInterval = 200; // 200ms마다 데이터 업데이트 - function animate(currentTime) { - if (currentTime - lastUpdateTime > updateInterval) { - updateData(); - lastUpdateTime = currentTime; - } + function animate() { + updateData(); drawGraph(); requestAnimationFrame(animate); } window.addEventListener('resize', resizeCanvas); resizeCanvas(); - animate(); + + setInterval(animate, 1000); })();