wrote simple implementations for toPieDataset and toCategoryDatset