add real time plot function for time series data