change your data cable or charger for this issue. most of the phone data cable is not durable. due to breakage in the internal wire of the cable voltages drops and charging IC get confused what to do. so in this case of every android phone always change your data cable or charger..
Regards.