Permalink
Browse files

Add a tick mark to the x axis for the box plot

  • Loading branch information...
1 parent 1d9f6cc commit 1413b7620bc0c30fdd6e69b642e1e454feed9e82 @hammer committed Feb 22, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 static/js/box_plot.js
View
@@ -108,4 +108,24 @@ d3.csv("f500.csv", function handleCSV(csv) {
.attr("dy", "0.5ex")
.attr("text-anchor", "end")
.text(y.tickFormat(5));
+
+ // x axis
+ var xrule = vis.selectAll("g.x")
+ .data(["CA"])
+ .enter()
+ .append("g")
+ .attr("class", "x");
+
+ xrule.append("line")
+ .attr("x1", w/2)
+ .attr("x2", w/2)
+ .attr("y1", h)
+ .attr("y2", h+4);
+
+ xrule.append("text")
+ .attr("x", w/2)
+ .attr("y", h+5)
+ .attr("dy", ".71em")
+ .attr("text-anchor", "middle")
+ .text(String);
});

0 comments on commit 1413b76

Please sign in to comment.