add formatter for legend
Merge pull request #470 from ersmo/feature/legend/formatter

add formatter for legend