Skip to content

Instantly share code, notes, and snippets.

@kforeman
Created June 7, 2013 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kforeman/5730691 to your computer and use it in GitHub Desktop.
Save kforeman/5730691 to your computer and use it in GitHub Desktop.
axis minor tickSize bug
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<style>
.axis path,line {
stroke: #000;
fill: none;
}
.axis text {
fill: #000;
}
</style>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<svg width='400px' height='400px'>
<script>
var sc = d3.scale.linear().range([50,350]);
var ax1 = d3.svg.axis()
.scale(sc)
.tickSubdivide(1)
.tickSize(10, 5);
var lb1 = d3.select('svg').append('g')
.attr('transform', 'translate(0,100)')
.classed('axis', true)
.call(ax1);
var ax2 = d3.svg.axis()
.scale(sc)
.tickSubdivide(1)
.tickSize(10, 5, 0);
var lb2 = d3.select('svg').append('g')
.attr('transform', 'translate(0,200)')
.classed('axis', true)
.call(ax2);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment