Greg Paperin - 2007-08-09

This is in response to the post "Using LiveGraph for my research".
(See: http://sourceforge.net/forum/forum.php?thread_id=1795084&forum_id=673036\)

Q: Can LiveGraph add or deletes a time series in real time?

In your question you do not specify whether you refer to the LiveGraph Plotter Application or to the LiveGraph Data Writer API which manages the log file.

The LiveGraph plotter application does not add, delete or manage data in any way. It plots the data on the screen. If a data series is present in the data file, it can be displayed or hidden by a single mouse click (see data series settings window). However, hiding a data series merely removes the corresponding plot from the screen, the data is not affected. Similarly, you can only display what is in the data file.

The LiveGraph Data Writer API for Java can be used by your application to stream your data into a file without worrying about how it works. Currently, the API is stream based. This means that you have to specify the number of data series and a heading for each series at the beginning. Once the first data set has been written, no new series can be added, as the series information is already sent "down the stream".
If you do not have all your series headings available at the start, but you know their maximum number, you can generate "place-holder" data series. At each time step of your simulation, you only specify the values for those data series, that are active at the given time. The values for other series will be specified as empty in the file. The LiveGraph plotter can handle that and "skip" points while plotting.
We are considering extending the LiveGraph Data Writer API in future to allow real adding and removing of data series for situations, in which the maximum number of series is not known at the beginning of the simulation. The problem with this is that LiveGraph normally only reads the new information in a data file at each update. Rewriting the complete data file to add or remove a data series will confuse LiveGraph's caching strategy. Therefore, that feature will only be possible in the "do not cache"-mode (see data file settings window). In addition, the operations for adding and removing data series will require recreating the entire data file by your application, which is a slow process as the file may be very big. While this feature is not yet available in the API, you can create the data files yourself, if you need this function urgently.

I hope this helps.

Cheers!