the line is repainted in d3.js

10 views
Skip to first unread message

Yeison Velez

unread,
Sep 23, 2017, 4:41:44 PM9/23/17
to d3-js


I'm trying to draw a line based on a few points that come with the help of a setinterval, I'm passing the points one at a time but I could also pass several. for now I want the points of the line to be drawn one at a time but without re-drawing those that have already been drawn. How can I solve this problem ?

http://plnkr.co/edit/JjIiqrf97Y8K7YUJRodo?p=preview

  var path=g.selectAll(".line1")
  .data(data)
    .enter()
    .append("path")
    .attr("class", "line1")
    .attr("d", function(d,i) { return (line(data)); })
    .style("stroke", function(d) { return "brown" });

in my real problem, I will receive points in real time that is why I am practicing how to draw point to point and generate an animation
https://i.stack.imgur.com/Xr5Lv.jpg

Reply all
Reply to author
Forward
0 new messages