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.
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++;}}
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.
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++;
}
}