This page demonstrates use of legendFormatter, which can be used to create more complex legends than valueFormatter.
legendFormatter
valueFormatter