draw the chart only when the box is open