FEATURE: adds a new chart report to track pageviews (#6913)

This commit is contained in:
Joffrey JAFFEUX
2019-01-21 15:17:04 +01:00
committed by GitHub
parent 52f2e0d6b9
commit b95165b838
11 changed files with 283 additions and 16 deletions

View File

@ -473,11 +473,26 @@ Report.reopenClass({
.utc(report[endDate])
.locale("en")
.format("YYYY-MM-DD");
report[filledField] = fillMissingDates(
JSON.parse(JSON.stringify(report[dataField])),
startDateFormatted,
endDateFormatted
);
if (report.modes[0] === "stacked_chart") {
report[filledField] = report[dataField].map(rep => {
return {
req: rep.req,
color: rep.color,
data: fillMissingDates(
JSON.parse(JSON.stringify(rep.data)),
startDateFormatted,
endDateFormatted
)
};
});
} else {
report[filledField] = fillMissingDates(
JSON.parse(JSON.stringify(report[dataField])),
startDateFormatted,
endDateFormatted
);
}
}
},