refactor NVD3Chart class