split code into a chart data manager