legend html markup cleanup
Graph: Tooltip refactoring for testability