I have an x-axis on my graph that plots the time by Day of the Month, Month, and 24hour time.
xScale = d3.time.scale()
.range([margins.left, width - margins.right])
.domain([new Date(this.startTime), new date(this.endTime)])
xAxis = d3.svg.axis()
.scale(xScale)
.tickFormat(d3.time.format("%d %b %I:%M))
This produces ticks that have the time formatted like:
29 Dec 12:00
But what I want is
29 Dec
12:00
That is, a line break after the month. I need this because the text sometimes overlaps other text when it is all on one line. Is there any way to insert this line break?
I tried
d3.time.format("%d %b <br> %I:%M)
Which is obviously wrong. But that should make clear what I'm trying to do.