updating the chart on upate