In this article, we will use GroupDocs.Assembly to generate a Column Chart Report with Filtered, Grouped, and Ordered Data in Presentation Document format based on the use case: Working with a Business Case.
importjsonfromdatetimeimportdatetimefromgroupdocs.assemblyimportDataSourceInfo,DocumentAssemblerdefparse_dates(item):# JSON has no dates: turn the order dates into datetime objects for the templateforkeyin("OrderDate","ShippingDate"):ifkeyinitem:item[key]=datetime.strptime(item[key],"%Y-%m-%dT%H:%M:%S")returnitemwithopen("orders.json",encoding="utf-8")asf:orders=json.load(f,object_hook=parse_dates)assembler=DocumentAssembler()assembler.assemble_document("chart-with-filtering-and-dynamic-title.pptx","chart-with-filtering-and-dynamic-title-report.pptx",[DataSourceInfo(orders,"orders"),DataSourceInfo("Harbor Lane orders by customer, 2015","title"),])