Save a few SQL queries for chart panel #2340
Save a few SQL queries for chart panel #2340

This could be optimized much more, but we better wait to
implement #2639

Ecodev/gims,Ecodev/gims,Ecodev/gims,Ecodev/gims,Ecodev/gims