reuse function for all charts