I have all of my data stored in a TimeSeriesCollection, and instead of making a graph with the data, I want to have the option of presenting the data in a table. The goal is to make it look something like this:
Name 5/1/2013 5/2/2013 5/3/2013
-------------------------------------------
Rick 12 0 82
Dale 1 0 0
Shane 0 0 159
How should I go about this? How do I get the data I want out of the TimeSeriesCollection?
I need to make a column for every possible X value in the series. Something like 5/2/2013 needs to show up, even though there is no data for it.
You can build a TableModel
around your TimeSeriesCollection
, although it might be more practical to transpose the table, identifying rows with the longer dimension. Your implementation of getValueAt()
can fill in missing data as needed. For reference, this related example extends AbstractTableModel
to return values from a Map<String, String>
.