Public
Edited
Oct 27, 2023
Insert cell
Insert cell
Insert cell
function generateData() {
const startDate = new Date('2023-01-01');
const endDate = new Date('2023-07-30');
const data = [];

for (let date = new Date(startDate); date <= endDate; date.setDate(date.getDate() + 14)) {
const enrolledCount = Math.floor(Math.random() * 200);
const screenedCount = Math.floor(enrolledCount + Math.random() * (200 - enrolledCount));

data.push({ date: formatDate(date), metric: "enrolled", count: enrolledCount });
data.push({ date: formatDate(date), metric: "screened", count: screenedCount });
}

return data;
}

Insert cell
Insert cell
newData = generateData()
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more