Flipping tooltip when reach end of graph