score:1

Accepted answer

To update domain across all line charts, we need to recalculate the domain before new data gets pushed in.

Plunker: http://plnkr.co/edit/AHWVM3HT7TDAiINFRlN9?p=preview

var newDomain = d3.extent(ids.map(function(d) {
  return aData[cont][d]
}));
var oldDomain = y.domain()
newDomain[0] = newDomain[0] < oldDomain[0] ? newDomain[0] : oldDomain[0]
newDomain[1] = newDomain[1] > oldDomain[1] ? newDomain[1] : oldDomain[1]
y.domain(newDomain)
domain.text(y.domain())

With respect to graph getting trimmed, data needs to be manipulated ( In your case, 14 arrays, push and shift operation to the array and D3 transition) all within a 1ms, which may not be enough. Unfortunately I don't have any resource to back this up. In case anyone can edit this answer to provide proof, please feel free.


Related Query

More Query from same tag