I’m using d3 to build a visualisation which includes a modified version of the calendar example:
http://mbostock.github.com/d3/ex/calendar.html.

I have turned my calendar by 90 degrees by changing the monthpath function:
function monthPath(t0) {
var t1 = new Date(t0.getFullYear(), t0.getMonth() + 1, 0),
d0 = +day(t0), w0 = +week(t0),
d1 = +day(t1), w1 = +week(t1);
return "M" + (d0) * z + "," + (w0 + 1) * z
+ "V" + w0 * z
+ "H" + 7 * z
+ "V" + w1 * z
+ "H" + (d1 + 1) * z
+ "V" + (w1 + 1) * z
+ "H" + 0
+ "V" + (w0 + 1) * z
+ "Z";
}
I would like to label the months, to the side of the calendar, at the start of each monthpath line. So I started by defining the month variable:
month = d3.time.format("%b"),
I am probably wrong but I am assuming I can insert my month variable into my monthpath function to print my labels? I’m trying to end up with a calendar similar to the one by Nathan Yau:
http://flowingdata.com/2012/01/11/vehicles-involved-in-fatal-crashes/

Any ideas?
thanks
This should do the trick – insert after the
svg.selectAll("path.month")block from the original example.You will also need to modify the margins to make room for the labels: