(
+
+ {capitalize(module)} Score Band in Interval
+ moment(date).format("DD/MM/YYYY")),
- datasets: [
- {
- type: "line",
- label: "Reading",
- fill: false,
- borderColor: COLORS[0],
- backgroundColor: COLORS[0],
- borderWidth: 2,
- spanGaps: true,
- data: intervalDates.map((date) => {
- return calculateTotalScore(
- stats.filter(
- (s) => timestampToMoment(s).isBefore(date) && s.module === "reading",
- ),
- ).toFixed(1);
- }),
- },
- ],
- }}
- />
-
-
- {/* Listening Score Band in Interval */}
-
- Listening Score Band in Interval
- moment(date).format("DD/MM/YYYY")),
- datasets: [
- {
- type: "line",
- label: "Listening",
- fill: false,
- borderColor: COLORS[1],
- backgroundColor: COLORS[1],
- borderWidth: 2,
- spanGaps: true,
- data: intervalDates.map((date) => {
- return calculateTotalScore(
- stats.filter(
- (s) => timestampToMoment(s).isBefore(date) && s.module === "listening",
- ),
- ).toFixed(1);
- }),
- },
- ],
- }}
- />
-
-
- {/* Writing Score Band in Interval */}
-
- Writing Score Band in Interval
- moment(date).format("DD/MM/YYYY")),
- datasets: [
- {
- type: "line",
- label: "Writing",
- fill: false,
- borderColor: COLORS[2],
- backgroundColor: COLORS[2],
- borderWidth: 2,
- spanGaps: true,
- data: intervalDates.map((date) => {
- return calculateTotalScore(
- stats.filter(
- (s) => timestampToMoment(s).isBefore(date) && s.module === "writing",
- ),
- ).toFixed(1);
- }),
- },
- ],
- }}
- />
-
-
- {/* Speaking Score Band in Interval */}
-
- Speaking Score Band in Interval
- moment(date).format("DD/MM/YYYY")),
- datasets: [
- {
- type: "line",
- label: "Speaking",
- fill: false,
- borderColor: COLORS[3],
- backgroundColor: COLORS[3],
- borderWidth: 2,
- spanGaps: true,
- data: intervalDates.map((date) => {
- return calculateTotalScore(
- stats.filter(
- (s) => timestampToMoment(s).isBefore(date) && s.module === "speaking",
- ),
- ).toFixed(1);
- }),
- },
- ],
- }}
- />
-
-
- {/* Level Score Band in Interval */}
-
- Level Score Band in Interval
- moment(date).format("DD/MM/YYYY")),
- datasets: [
- {
- type: "line",
- label: "Level",
- fill: false,
- borderColor: COLORS[4],
- backgroundColor: COLORS[4],
- borderWidth: 2,
- spanGaps: true,
- data: intervalDates.map((date) => {
- return calculateTotalScore(
- stats.filter((s) => timestampToMoment(s).isBefore(date) && s.module === "level"),
- ).toFixed(1);
- }),
- },
- ],
- }}
- />
-
+ }}
+ type="line"
+ data={{
+ labels: intervalDates.map((date) => moment(date).format("DD/MM/YYYY")),
+ datasets: [
+ {
+ type: "line",
+ label: capitalize(module),
+ fill: false,
+ borderColor: COLORS[index],
+ backgroundColor: COLORS[index],
+ borderWidth: 2,
+ spanGaps: true,
+ data: intervalDates.map((date) => {
+ return calculateTotalScore(
+ stats.filter(
+ (s) => timestampToMoment(s).isBefore(date) && s.module === module,
+ ),
+ 1,
+ ).toFixed(1);
+ }),
+ },
+ ],
+ }}
+ />
+