Updating chart logic