The man accused of going on a shooting rampage in a suburban Los Angeles real estate office last week has been formally charged.