Sha256: ebc4b795c00031db624680a4e37092006a3d88212810cbcfbbaeb04c2cb1bfac
Contents?: true
Size: 1.16 KB
Versions: 25
Compression:
Stored size: 1.16 KB
Contents
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="../../d3.js"></script> <style type="text/css"> body { font: 10px sans-serif; } rect { fill: #ddd; } .grid line { stroke: #fff; } .grid line.minor { stroke-width: .5px; } .grid text { display: none; } .axis line { stroke: #000; } path { display: none; } </style> </head> <body> <script type="text/javascript"> var m = [10, 10, 20, 10], w = 960 - m[1] - m[3], h = 80 - m[0] - m[2], x = d3.scale.linear().domain([.05, .95]).range([0, w]), y = d3.scale.linear().range([0, h]); var svg = d3.select("body").append("svg") .attr("width", w + m[1] + m[3]) .attr("height", h + m[0] + m[2]) .append("g") .attr("transform", "translate(" + m[3] + "," + m[0] + ")"); svg.append("rect") .attr("width", w) .attr("height", h); svg.append("g") .attr("class", "x grid") .attr("transform", "translate(0," + h + ")") .call(d3.svg.axis().scale(x).tickSubdivide(1).tickSize(-h)); svg.append("g") .attr("class", "x axis") .attr("transform", "translate(0," + h + ")") .call(d3.svg.axis().scale(x)); </script> </body> </html>
Version data entries
25 entries across 25 versions & 1 rubygems