scorelab / dengue-stop-old

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

Analytics Section: Bar Graph of number of cases #278

Open rheo-chiti opened 4 years ago

rheo-chiti commented 4 years ago

This solves #284

Bar Graph 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 cases of the past 5 days worldwide.

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 < dates.length; i++) { if (dates[i] == dates[i + 1]) { count++; } else { dates.push(count + 1) count = 0 } } this.setState({ data: dates.slice(0,5) })