simplified logic for updating bar charts when they are visible/invisible