As the reference height is at B, so above that reference height is considered positive, and below the reference height it is considered negative. Hence the height-time graph is as such.
Consider a vertical oscillating object, similar to the simple pendulum, the middle is the fastest.