update the chart logic