tried moving most histogram variables outside of the draw chart function - but now y-axis range is wrong