Nexus 4 problems when charging
There are a few things that could be happening here:


It could be that the charger is not powerful enough (either something happened to it or it never was). This means that although charge is going into your phone the phone is using it too fast to add any battery life. To see if this is the case try to charge your phone when it is off or in airplane mode.
A software issue could be causing the charging circuit to disengage due to excess charge (this is pretty much a guess). 
The battery level on the phone (or charging symbol) may not be accurate and therefore not give an accurate representation of charging. To test this see if the phone gains actual usable charge when plugged in (leave it overnight starting at close to 0% and if it makes the night your all good).


Hope this helps.

[EDIT]

Looking at your CPU monitor I have a few more suggestions that might help (more in diagnosing than anything).

Attempt to connect your phone via ADB and access your phone via adb shell (there should be some tutorials around the web which I may post later).

Then use the "top" command to view all running processes.

Identify the offending process (it should have a high CPU load and be named system_server)

Get the PID of the process and run the command: "kill PID" with PID being the PID of the process.

See if this fixes the issue.

Let me know what happens or if you run into any issues (I really want to figure this out now).