Clear barchart before rendering it

When refreshing the bar chart, it is necessary to clear the html
before rendering it. Otherwise the old chart remains on the page,
and the new one is added on top of it. This patch ensures that
the old chart is cleared first, before rendering the new chart.

This also replaces occurrences of .html('') with .empty(),
as the latter is more efficient and explicit.

Closes-bug: #1307563
Change-Id: I5705cb82093dcf45b5111f5ab52d3dfda74ce64a
Merge "Clear barchart before rendering it"