chart directive, prepare generation of chart data