Like the question here , I worked on the same as in the last question. My question now looks like a link, but more about implementation. When I run my code, I get an error in my log saying: "TypeError: x.ticks is not a function." This is the part of the code it refers to:
svg.selectAll("g.grid") .data(y.ticks()).enter() .append("g").attr("class", "grid") .selectAll("rect") .data(x.ticks()) .enter() .append("rect") .attr("x", function(d, i, j) { return xScale(j); }) .attr("y", function(d, i, j) { return yScale(i); }) .attr("width", xScale.rangeBand()) .attr("height", yScale.rangeBand()) .attr("fill", function(d, i) { return ((i) % 2) == 1 ? "green" : "blue"; });
This code works fine in this script, but gives me an error when running in my code, as shown here . Any help?
Alexey Ayzin
source share