create wrapper function to generate charts