Add getPositiveWeightForDaysAgo(), that returns only positive weights;

Add algorithm description for getTrendFor()
Add part of getTrendFor() method.
It splits initial array into two parts, 'left' and 'right' one.
Finish getTrendFor(), now it correctly calculates trend line for given $weight array.
Transfer data from controller to template to display trend line ( if appropriate data is available )
Auto format.
Set whole graph format to depend from trend format chosen
Add thickness for trend line
Fix trend line do not appear for no time period set
Add code to calculate edge points of trend line.
Set menu to redirect onclick.
Convert code to suit php 5.2.17 version:

 - add MyDateTime class to avoid DateTime->setTimestamp() bug of this version of PHP;
 - describe functions, used in array_map, separately, not as a line;
 - unfold class declarations.
Cosmetics; remove obsolete variable