Further generalization of chart data

Note: the dataset attribute of charts has been renamed to datasets

During translation, the generation of chart data now depends on the
specific flavor of chart. The intention is to avoid redundant data
conversion in the javascript backend.