Adding Grid to D3.js Line Chart -


i have line chart here:

jsfiddle.net/yfqq4/

my problem is, don't proper grid in background working legend (y , x-axis) this: http://lab.creativebrains.net/linechart.png

can can post me code snippet how should implement or that?

thanks!

you can draw background grid this:

//vertical lines svg.selectall(".vline").data(d3.range(26)).enter()     .append("line")     .attr("x1", function (d) {     return d * 20; })     .attr("x2", function (d) {     return d * 20; })     .attr("y1", function (d) {     return 0; })     .attr("y2", function (d) {     return 500; })     .style("stroke", "#eee");  // horizontal lines svg.selectall(".vline").data(d3.range(26)).enter()     .append("line")     .attr("y1", function (d) {     return d * 20; })     .attr("y2", function (d) {     return d * 20; })     .attr("x1", function (d) {     return 0; })     .attr("x2", function (d) {     return 500; })     .style("stroke", "#eee"); 

you can see here how works jsfiddle (updated): http://jsfiddle.net/cuckovic/phzvy/


Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

tsql - Pivot with Temp Table (definition for column must include data type) -- SQL Server 2008 -