Created
June 7, 2013 16:54
-
-
Save kforeman/5730691 to your computer and use it in GitHub Desktop.
axis minor tickSize bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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