Adds event handler to tick labels