added an option to specify a formatter function for labels (tooltip)