improved statistic, moved chartData to functions