preparing data for using chart library