Plot.plot({
width: 900,
height: 900,
marginLeft: 50,
marginRight: 20,
marginTop: 50,
marginBottom: 50,
y: {
label: "Dates d’acquisition",
domain: [2002, 2023],
tickFormat: d => d.toString().substr(0, 4),
},
x: {
label: "Dates de production",
domain: [1900, 2023],
tickFormat: d => d.toString().substr(0, 4),
tickRotate: -45,
},
marks: [
Plot.dot(
data,
Plot.bin({r: "count"},
{x: "date", y: "acquisitionDate", thresholds: 60, tip: true},),
),
Plot.linearRegressionX(data, {x: "date", y: "acquisitionDate", stroke: "red"}),
Plot.crosshairX(data, {x: "date", y: "acquisitionDate"})
],
color: {
legend: true,
scheme: "Set2",
range: ["blue"]
}
})