We covered this in
another thread recently.
Visa-free transit is as follows:
http://www.china-embassy.org/eng/hzqz/zgqz/t84242.htm
★Visa-free transit
1. Visas are not required of aliens who hold air tickets to the final destination and have booked seats on international airliners flying directly through China, and will stay in a transit city for less than 24 hours without leaving the airport.
2. Visas are not required of passport holders of the following countries, who transit through Pudong Airport or Hongqiao Airport of Shanghai, provided they hold valid passports, visas for the onward countries, final destination tickets and have booked seats, and stay in Shanghai for less than 48 hours : Republic of Korea, United States, Canada, Australia, New Zealand, Germany, France, Netherlands, Belgium, Luxemburg, Portugal, Spain, Italy, Austria, Greece, Sweden, Denmark, Norway, Finland, Iceland.
Of the above 1 obviously doesn't apply as it's referring to traditional airside transit.
2 might be helpful to you - it depends on where you are coming from and going too. You can get a bit of flexibility and be allowed things like YVR-PVG-ICN, but don;t try classing YVR-PVG-SEA as a transit!
Otherwise it will be a case of obtaining a visa in advance from the Chinese Consulate.