From 5bbb4224954d3e9cb7797fa8dab4f38ec931db13 Mon Sep 17 00:00:00 2001 From: Redume Date: Mon, 12 Aug 2024 16:33:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B1=D0=B0=D0=B3.=20=D0=A0=D0=B0=D0=BD=D0=B5=D0=B5?= =?UTF-8?q?=20=D0=B5=D1=81=D0=BB=D0=B8=20=D0=BD=D0=B5=20=D0=B1=D1=8B=D0=BB?= =?UTF-8?q?=D0=BE=20=D0=B2=D0=B0=D0=BB=D1=8E=D1=82=D1=8B=20=D0=B2=20=D0=B1?= =?UTF-8?q?=D0=B4,=20=D0=BD=D0=BE=20=D0=B2=D1=81=D0=B5=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BD=D0=BE=20=D0=B2=D1=8B=D0=B4=D0=B0=D0=B2=D0=B0=D0=BB?= =?UTF-8?q?=D0=BE=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA.=20=D0=98=D1=81?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chart/main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chart/main.js b/chart/main.js index 3b75389..a91cea7 100644 --- a/chart/main.js +++ b/chart/main.js @@ -21,7 +21,7 @@ async function gen_chart(from_currency, conv_currency, start_date, end_date) { end_date ]); - if (!data) return new Error('Missing data'); + if (!data['rows'][0]) return 'Missing data'; const date = []; const rate = []; @@ -54,7 +54,6 @@ async function gen_chart(from_currency, conv_currency, start_date, end_date) { labels: date, datasets: [ { - label: 'rate', borderColor: rate[0] < rate[rate.length-1] ? 'rgb(24, 218, 39)' : 'rgb(243, 85, 50)', backgroundColor: rate[0] < rate[rate.length-1] ? 'rgb(36, 175, 47)' : 'rgb(218, 56, 24)', data: rate,