little refactor: chart_type as a parameter