add part of logic for correct drawing the chart