rewrite panel does some layout before displaying graphs