add formatter option for legend, usually for localization

add formatter for legend, thank you!