make dynamic height for graphs