I have to display a growing line chart which is updated every 100ms. I find a way to properly update the data with :
path
.attr("d", line)
.attr("transform", null)
.transition()
.duration(100)
.ease("linear")
.attr("transform", "translate(" + x(0) + ",0)")
.each("end", tick);
But I have issue with Y axis domain.
I define my Y axis like that :
var y = d3.scale.linear()
.domain([-1, 1])
.range([height, 0]);
and then I update it on each refresh with the instruction :
y.domain([avg - 10, avg + 10])
It works but I have a bad "clipping" effect.
Demo: https://jsfiddle.net/j499oy0e/
How to remove it with transition or something similar?