diff options
Diffstat (limited to 'covid-uk/src/index.html')
-rw-r--r-- | covid-uk/src/index.html | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/covid-uk/src/index.html b/covid-uk/src/index.html deleted file mode 100644 index bb14426b14f8..000000000000 --- a/covid-uk/src/index.html +++ /dev/null @@ -1,46 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>Covid UK</title> -</head> -<body> - <canvas id="myChart" width="400" height="400"></canvas> - <script src="./node_modules/chart.js/dist/Chart.bundle.min.js"></script> - <script> - var timeseries = - fetch('https://pomber.github.io/covid19/timeseries.json') - .then(res => res.json()) - .then(createChart); - - function createChart(data) { - var uk = data["United Kingdom"]; - var data = uk.map(x => x["confirmed"]) - var labels = uk.map(x => x["date"]) - - var ctx = document.getElementById('myChart').getContext('2d'); - var myChart = new Chart(ctx, { - type: 'line', - data: { - labels: labels, - datasets: [{ - label: 'Number of confirmed COVID-19 cases in the U.K.', - data: data, - backgroundColor: 'rgba(255, 0, 100, 0.2)', - borderWidth: 3 - }] - }, - options: { - scales: { - yAxes: [{ - ticks: { - beginAtZero: true - } - }] - } - } - }); - } - </script> -</body> -</html> |