advweb-grp1 / advanced-web-final-year-project

Final year advanced web develop unit project
MIT License
1 stars 0 forks source link

Feature/dashboard daniel #47

Closed D4ni3l8 closed 1 year ago

D4ni3l8 commented 1 year ago

Showing the myectomy pie chart.

github-actions[bot] commented 1 year ago

Visit the preview URL for this PR (updated for commit 3ffda62):

https://adv-web-grp1--pr47-feature-dashboard-da-2um9i69p.web.app

(expires Mon, 01 May 2023 20:10:13 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e45f8bd17b7de44787580bea572e36aa09784b8c

advweb-grp1 commented 1 year ago

current logic to filter for the age distribution is flat out wrong.

    if (10 <= age <= 30) {
      age10to30++;
    }
    else if (31 <= age <= 40) {
      age31to40++;
    }
    else if (41 <= age <= 50) {
      age41to50++;
    }
    else if (51 <= age <= 60) {
      age51to60++;
    }
    else if (age > 60) {
      above60++;
    }

All documents will filter in the first condition

advweb-grp1 commented 1 year ago

Proper way to do it:

if (age >= 10 && age <= 30) {
  age10to30++;
}
else if (age >= 31 && age <= 40) {
  age31to40++;
}
else if (age >= 41 && age <= 50) {
  age41to50++;
}
else if (age >= 51 && age <= 60) {
  age51to60++;
}
else if (age > 60) {
  above60++;
}