fdo#77739 UI trendline: limit max values of Degree and Period

Retrieve the number of valid points and limit Degree and Period values

Change-Id: I4e956149e3376eebf39f9e4812bb69a6a06e1758
Reviewed-on: https://gerrit.libreoffice.org/9116
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>