The charger may be the problem. I would suggest trying another charger (just make sure it is the right one for your device), perhaps you can borrow one, and see if that resolves the issue. If so, then you need a new charger.
However, should that not resolve it, and the problem continues, then the laptop will need to be looked at to see if there is something short circuiting when the charger is connected. If under warranty, contact the manufacturer. If not, then try a local tech.