Trends Screen
In the Analytics Section, users can view the graphs, charts, trends of reports and status of an area.
Users can view the total number of cases reported worldwide by days.
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}}for (let i = 1; i < dates.length; i++)dates[i] += dates[i - 1]this.setState({ data: dates })
This solves #283
Trends Screen
In the Analytics Section, users can view the graphs, charts, trends of reports and status of an area. Users can view the total number of cases reported worldwide by days.
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
}
}
for (let i = 1; i < dates.length; i++)
dates[i] += dates[i - 1]
this.setState({ data: dates })