update bar chart dynamically