Refactor metric chart out of this file.