Fix empty histogram during range selection.

getCanvas() accidentally cleared the canvas. I've moved the updating of canvas.width/.height into the render method.
Merge pull request #32 from mstange/fix-range-selection

Fix empty histogram during range selection.