Dynamic tooltip position based on chart boundaries

NB: i didn't update minified version of the script because i wasn't sure which minification tool to use.