screen placement

screen placement

I am trying to place an object in the middle height wise of an area of the screen. I thought this code would work to calculate the Y position of my object:
  1. var y = $chart.offset().top + $chart.outerHeight()/2;
But the object is displaying about 60% from the top of the chart. Here are some actual numbers from the debugger:

  1. $chart.offset().top
  2. 367.79999923706055
  3. $chart.outerHeight()
  4. 451
  5. y
  6. 593.2999992370605
What would be the correct way to do something like this?