refactor chart generation code and UI style