Refactored chart_type