put chart-logic in c_chart.