I have a document set up like this:
name:
data: [
{date: (ISO)
numberCorrect: 8
numberTotal: 10}
{date: (ISO)
numberCorrect: 9
numberTotal: 10}
{date: (ISO)
numberCorrect: 4
numberTotal: 5}
]
I want to create a chart that will show changes over time to the numberCorrect/numberTotal field. So, in this example, a line graph where the first entry is at 80% for that date, then the next date is 90%, then the next date is 80% again.
Can MongoDB charts do this or do I need to structure the data in a different way? I need to keep the # correct and # total, I can’t store as a straight percentage because sometimes totals over a period of time will also need to be calculated (in this example the actual average is 84%, but if I stored as percentages the average would calculate to 90%.)
How can I display the data in the way? Thank you!