Time-series forecasting
Something simlar to the blue fitted line can be obtained using Holt-Winters model. Check HoltWinters() function from stats package in R.

You can find some examples here and here.