identify negative numbers too.
when usetime=true, update xmax to now().