Make chart generator modular