I have an application which is generating random datasets each second like:
Dataset 1:
[{time:"00:00:01",class:"Class_A",stats:"45"}]
Dataset 2:
[{time:"00:00:02",class:"Class_A",stats:"50"},{time:"00:00:02",class:"Class_B",stats:"45"}]
Dataset 3:
[{time:"00:00:03",class:"Class_A",stats:"30"}]
Dataset 4:
[{time:"00:00:04",class:"Class_A",stats:"60"}]
Dataset 5:
[{time:"00:00:05",class:"Class_A",stats:"50"}]
Dataset 6:
[{time:"00:00:06",class:"Class_A",stats:"10"},{time:"00:00:06",class:"Class_B",stats:"60"}]
.
.
.
So, at particular sec a new dataset is generated by the system and we don't know in advance the class whose data will appear e.g. at second 2, dataset contained data of class A and class B both but in next three seconds class B's data did not appear which by the way does not mean that class B's stats is equal to zero. When data for a particular dataset does not appear it should not be plotted at all.
What is the best way to visualize this kind of disjoint data? I was thinking about visualizing it with the help of realtime multi-line chart using d3.js but d3 will expect to have data for each class at a particular instance otherwise it will show it as zero whereas when data is not present its line should not be drawn at all.