How to wrap long tick text in Observable using the Plot.plot function? Can I use tickFormat for this?
With D3 I solved it like this. How can I solve this with the Plot.plot function?
svg.select(".x_axis")
.call(xAxis.tickFormat(d3.timeFormat("%d-%m-%Y %H:%M:%S")))
.selectAll("text")
.call(function (t) {
t.each(function (d) {
var self = d3.select(this);
var s = self.text().split(' ');
self.text(null);
self.append("tspan")
.attr("x", 0)
.attr("dy", ".8em")
.text(s[0]);
self.append("tspan")
.attr("x", 0)
.attr("dy", "1.2em")
.text(s[1]);
})
});
Edit: Link to notebook
Thank you.