scorelab / dengue-stop-old

Dengue-Stop
Apache License 2.0
25 stars 64 forks source link

Analytics Section: Pie Charts of Number of reported Diseases #279

Open rheo-chiti opened 4 years ago

rheo-chiti commented 4 years ago

This solves #285

Pie Chart Screen
In the Analytics Section, users can view the graphs, charts, trends of reports and status of an area. Users can view the number of diseases reported in a pie chart format.

image

Data is fetched from firebase and converted into meaningful data to be used for trends screen with the help of react-native-svg-charts.

This code snippet will convert the data into meaningful data:-

for (let i = 0; i < diseases.length - 1; i++) { if (diseases[i] == diseases[i + 1]) { count++; } else { data.push({ key: key, amount: count+1, }) count=0; key++; } }