Replace 2 delays by sampleFrequency
Add shifting to chart when the data are older than 10s