Javascript time series plotting recipe