improve chart data structure