Reputation: 125
I am facing an issue while updating the dots on line chart. if total number of data remains same, it works but if number of data changes, i am not able to update the circle and tool tip.I know there is isssue with enter and update section. Here is the Fiddle Link
blueCircles.data(data)
.enter().append("circle")
.attr("r", 4)
.attr("cx", function(d) { return x(d.qName); })
.attr("cy", function(d) { return y(d.close); })
.style("fill", "white")
.style("stroke", "blue")
.style("stroke-width", "2px")
.transition()
.duration(750);
Any help in this regard is highly appreciated
Upvotes: 0
Views: 935
Reputation: 1631
I know this is a late answer. But if someone searches for a solution this might help.
The problem was this line:
var svg = d3.select("body").transition();
After I cleaned it out, I got rid of some strange errors and was able to add circles to the svg.
Here is a working fiddle: http://jsfiddle.net/noo8k17n/
Upvotes: 1