Public
Edited
Aug 31, 2023
Insert cell
Insert cell
x = d3.scale.ordinal()
.rangepoints([0, width], 0.5);
.domain(data.map(d => d.day));
Insert cell
dots = svg
.selectall("circle")
.data(data)
.enter()
.append("circle")
.attr("class", "dot")
.attr("r", 3.5)
.attr("cx", function (d) {
return x(d.day);
})
.attr("cy", function (d) {
return y(d.amount);
})
.style("fill", function (d) {
return color(d.fruit);
})
.style("opacity", 0.5)
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