Closed dalejung closed 11 years ago
https://github.com/mbostock/d3/issues/583 touches on this too. Though not applicable here since all my .data() is just the index values.
finished fixing line issue with https://github.com/dalejung/id3/commit/24d3fa9ce202aedf023141e75c4f349950ea6852
Also, fixed the partial data problem where the line showed up at 0.
This can happen when you have multiple datasets that don't align perfectly on the x-axis.For example, stock A might not have data for the entire period.
There are two scenarios with this:
Right now this errors for candlestick and line because the y scale has [NaN, Nan] for its domain and thus returns NaN.
So the question is, what is the correct path to handle empty data? Remove the DOM elements or just make them hidden?
While not on purpose, I think how the first case is handled is better. There won't be any overhead in creating and destroying dom elements, and if you're just panning the brush, the correct number of DOM elements will stay on screen.
So yeah, do that.