fixed function so charts are not dropped when the mouse leaves the boundaries when dragging a chart