Skip to content

Instantly share code, notes, and snippets.

@ESeufert
Created May 2, 2014 09:12
Show Gist options
  • Select an option

  • Save ESeufert/4a03e7a397e07d29d4c6 to your computer and use it in GitHub Desktop.

Select an option

Save ESeufert/4a03e7a397e07d29d4c6 to your computer and use it in GitHub Desktop.
var yAxis = d3.svg.axis()
.scale(y)
.orient("left")
.ticks(5);
var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom")
.ticks(5);
vis.append("g")
.attr("class", "axis")
.call(yAxis);
vis.append("g")
.attr("class", "axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis);
//add the axes labels
vis.append("text")
.attr("class", "axis-label")
.attr("text-anchor", "end")
.attr("x", 20)
.attr("y", height + 34)
.text('Date');
vis.append("text")
.attr("class", "axis-label")
.attr("text-anchor", "end")
.attr("y", 6)
.attr("dy", "-3.4em")
.attr("transform", "rotate(-90)")
.text('Daily Active Users');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment