0

i'm using d3, and i find myself with a problem making a bar chart with time scale in the x axis,
this.columns = svg.selectAll("rect") .data(data); this.columns.enter().append("rect") .attr("class", "bars") .attr("clip-path", "url(#clip)") .attr("width", tempW ) .attr("x", function(d) { return x(d.date); }) .attr("y", function(d) { return return y(d.values["count"]);} ) .attr("height", function(d) { return height4 - y4(d.values["count"])-0.5; })
this is the code that i'm using, the problem is that it always leave one column (bar) out, for example if the data array have 120 items, it prints 119, when i made a console.log to the enter() function, i discovered that the data index (in the enter() call) is starting from 1 and not from 0, which cause that whatever item is in the first position is missing, i don't know why is this happening.

Douglas Cardona
  • 151
  • 1
  • 6

0 Answers0