calculate the graph area based on the relative size