fix TypeError rendering threshold with format=json

naive implementation of fix proposed in #375
When using format=json on a target with the threshold or constantLine function, an exception is raised : 
TypeError: range() integer end argument expected, got float.
This fix transforms the range() parameters into integers before they are passed to the function.
the threshold target is then displayed as a single point with a -1day timestamp.