Hello,
I’m trying to make a timeline using Plot regarding internet shutdowns in different countries. In my dataset I have a start date and end date so I’m able to see these on the chart. However, some internet shutdowns are ongoing so there is no end date on certain records - in these situations they don’t appear on the chart and I don’t know how to work around that. Does anyone know if there is a way to create a conditional so if the end date is null it’s marked from the start date to the end of the timeline? Or another alternative?
Thanks
This is my code here:
Plot.plot({
color: {legend: true},
marginLeft: 150,
marginBottom: 50,
width: 1000,
height: 1000,
axis: true,
x: {
axis: "top",
grid: true,
},
marks: [
Plot.barX(dataShutdown, {
x1: "start_date",
x2: "end_date",
y: "country",
sort: {y: "x1"},
fill: "shutdown_type",
}),
]
})
This is what the chart looks like so far: