Would you be able to test with other cable and adaptor? and check software update on setting.
after that backup your data and do factory reset and test. If it's still same, I think charging port defect or main board defect. I recommend you find service center and get service.