Welcome to iMore!
My sugesstions. Had the same issue with a 5s. First try a hard reset. Push and hold the home & power button at the same time until you see the logo, then release. If that does not work, try a different cable or charger, plugged into wall or computer for at least 24 hours. Leaving mine plugged in for 24 hours solved the problem and it has never happened again. If these suggestions do not solve the problem, I would then make a Genius appointment and have it looked at.