adds chart_sql
fixes the bug in the charts
fixes some conflicts in chart helper