Correct amount of samples in the chart

We need to always show some reasonable amount of samples in the chart.

It was hardcoded to 1000s time windows, when there will be a
several months of data, it will be a great amount of samples.

It needs to be changed to always show some reasonable amount of samples
(I would say 400)

Also exceptions added for unexpected states of dates.
Date_from has been changed to beginning of the day, and date_to to
the end of that day.

Fixes bug 1221566
Change-Id: I60cd0aa0882c5b8890d61b649c312d4f7e9ddf82
Merge "Correct amount of samples in the chart"