display bar-chart only if its html element exists