Avoid an error when the statistics column hasn't been populated

The 'if data' needs to be earlier to avoid an error if one of the
statistics columns hasn't been filled in by the
stats:update_public_bodies_stats rake task yet.

Thanks to Louise Crow for pointing this out in code review.
Merge branch 'stats-graphs-improvements' into rails-3-develop