It is frequently said that electric vehicles are not as "green" as people might think as the electricity used to charge them generates a lot of carbon dioxide. Performing an analysis is difficult as you must use equivalent vehicles, use realistic driving styles (as opposed to EPA ratings), consider the amount and source of energy used to manufacture the car, and know the source of power that is used to charge the batteries.
I've done this for Leaf class vehicles in the US and found that their use is always "greener" than similar gasoline powered cars in most states, but not in Washington DC, North Dakota, Wyoming, Indiana, Illinois and Kentucky due to the amount of percentage of coal generated electricity. If you compare the pure electrics to Prius class hybrids or diesels the numbers shift a bit. With Prius class hybrids there are about a half dozen more states where the greener choice would be the hybrid. Diesels fall somewhere in between.
My analysis was done with EPA data from 2009 - the last time I had a breakdown of power generation at the state level. I suspect pure electrics are a better choice now because so many power plants have been converted to natural gas in the US.
If you have local clean electricity, electric vehicles can be much better. Here is a summary of an analysis that looks at equivalent vehicles in the 20mpg gasoline class and calculates and effective miles per gallon of carbon dioxide emissions. Countries that get most of their electricity from clean sources will do much better. (if you think in terms of g CO2e/km as I do, a chart for that is included).
The devil is into the details, but the ordering and scale looks about right. (A fly in the ointment is manufacturing costs are added, but assume manufacture was in the country where the car is used) But the bottom line is electrics in places like China and India are no better, and possibly worse, than average gasoline cars. They are the North Dakotas of the world or at least the 2009 NDs). In general electrics are a move in the right direction and, assuming electric power generation becomes greener, they will only improve.