reusable chart pattern implemented