I don't think that mine has ever rebooted for no apparent reason.
The first thing I always think when I hear that is that some 3rd party program is misbehaving.
First thing to try would be to delete any programs you've added that you don't use regularly. (I'm sure we've all got programs that we installed that sounded cool, but we don't actually use any more).
If that doesn't help then try removing widgets from your home screen (make the widget not run, you may or may not have to uninstall the app itself).
Last would be to start removing apps you use, one by one, to see if any of them are causing the problem.
You could also try checking the 'running services' tab, but there are always things there that look odd (to me at least), but aren't really causing harm. And to be truly effective you'd need to check this just seconds before a reboot - and I suspect you don't know when that is. If you check it after the unit has rebooted the problem app may or may not be running (yet).
Good luck
Edit: if it ONLY happens while charging, I suppose it's possible you have a bad charger. If you have a different charger give that a try. If it happens quickly when charging then you might try going to a local store and plugging in to their charger to see what happens.