calculations done for chart