Skip to content

Commit

Permalink
clean up the unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua1988 committed Nov 15, 2020
1 parent 497dd3e commit 27ae41c
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions project/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,13 @@ async function handleListClick(event) {
selectedId,
'confirmed',
);
console.log(confirmedResponse);
endLoadingAnimation();
setDeathsList(deathResponse);
setTotalDeathsByCountry(deathResponse);
setRecoveredList(recoveredResponse);
setTotalRecoveredByCountry(recoveredResponse);
setChartData(confirmedResponse);
isDeathLoading = false;
// console.log(data);
}

function setDeathsList(data) {
Expand Down Expand Up @@ -159,33 +157,20 @@ function endLoadingAnimation() {
recoveredList.removeChild(recoveredSpinner);
}

//
async function setupData() {
const { data } = await fetchCovidSummary();
console.log(data);
setTotalConfirmedNumber(data);
setTotalDeathsByWorld(data);
setTotalRecoveredByWorld(data);
setCountryRanksByConfirmedCases(data);
setLastUpdatedTimestamp(data);
// renderChart();
}

function renderChart(data, labels) {
var ctx = $('#lineChart').getContext('2d');
const defaultLabel = [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
];
const defaultData = [0, 10, 5, 2, 20, 30, 45];
Chart.defaults.global.defaultFontColor = '#f5eaea';
Chart.defaults.global.defaultFontFamily = 'Exo 2';
var chart = new Chart(ctx, {
new Chart(ctx, {
type: 'line',
data: {
labels,
Expand Down

0 comments on commit 27ae41c

Please sign in to comment.