histogram: show selection range in tooltip while selecting

also fixes bugs in the histogram selection code

backported from tx_find

https://github.com/subugoe/typo3-find/commit/53fc211ca8185fd9b85f4456eaf7bb6d8404338e
https://github.com/subugoe/typo3-find/commit/09730e8c65037db9e676ead6db8687e7be19fd5c