A few days ago the charger started sparking and part of it melted.
Obviously not a good sign, possible causes include a faulty charger, a short circuit in the system board (can be caused by the power jack at the rear of the laptop coming away from the MB) or a mains power issue (power surge or bad wall socket).
I plugged a different Dell chareger into it and it wont charge at all.
Was it the correct type of charger, they are not all the same as they have different outputs and connection plugs (length and diameter).
Just wondering if theres anyway to know if this a battery issue, a charger issue or a an issue in the laptop itself
Try a known good charger and battery that are the correct type for the laptop, check the laptops power jack is secure and have the wall socket checked out.
NB: Just a FYI, Dell computers are known to not work well with non propriety components so please avoid cheap replacements.