insert hist data and retrieve x and y values