For a given dashboard most users can navigate to the statistics page where they can view a graph of their overall progress. The score for each standard is stored from a number between 0 to 4. Therefore, the best way to represent this data is to convert
each score to a percentage. As a result, we get a line chart with the Score (as a percentage) on the Y-axis and the Time (in Days) on the X-axis.
The system makes use of the
Line
component from the
react-chartjs-2
library which is a react wrapper for the Chart.js library. Since Chart.js is a client-side JavaScript library we are required to have a specific
format to render the graph. Therefore, we created another react component called
LineChart
to format the data from our API call to our PostgreSQL to correctly feed it into the Chart.js
Line
component. Before formatting
our data, we use a GET request to
/api/responses
to retrieve all relevant data for a user. Also, following the Chart.js documentation, we can can utilise the legend selection to filter the line chart when the graph may be too
complicated to analyse invidual health and care standards.
Quick Summary
Quick Summary section of the statistics page shows a mean of all self-assessments taken for the given dashboard. The section comprises of a
Circle Accordion
which makes use of the built-in
Circle
component
from react-suite. The process of calculating the average statistic for each health and safety standard is handled on the backend.
Personal Analytics
Like the quick summary section, personal analytics displays messages depending on the average of all self-assessments taken for the given dashboard. To do this we used the
Message
and
Panel
Component from react-suite
to list each piece of information respectively. The following cases show which message is displayed depending on the average performance:
Message |
Average Performance, p |
|
p ≥ 75% |
|
25% < p < 75% |
|
p ≤ 25% |
Additionally, when a user has not been able to complete a self-report in a week, the following information is concatenated with the other previous messages: