clearing chart in a separate method