Skip to content

Commit

Permalink
🐛 Fix data for generating graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Dec 3, 2020
1 parent 443926e commit 3a41059
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const generateGraphs = async () => {

for await (const site of config.sites) {
const slug = slugify(site.name);
if (!slug) continue;

let uptime = 0;
let uptimeDay = 0;
Expand Down Expand Up @@ -223,12 +224,12 @@ export const generateGraphs = async () => {
await canvasRenderService.renderToBuffer({
type: "line",
data: {
labels: [1, ...responseTimes.map((item) => item[0])],
labels: [1, ...dataItem[1].map((item) => item[0])],
datasets: [
{
backgroundColor: "#89e0cf",
borderColor: "#1abc9c",
data: [1, ...responseTimes.map((item) => item[1])],
data: [1, ...dataItem[1].map((item) => item[1])],
},
],
},
Expand Down

0 comments on commit 3a41059

Please sign in to comment.