Sales Performance Report ========================= A chart-driven business report: KPI stat cards, a pie + histogram dashboard on one ````, a year-over-year trend chart, and a top-accounts table — the example to reach for when your document is built around data visualization rather than tables of text (see :doc:`../craft_language/charts` for the full ```` reference). Template — ``sales_report.craft`` ------------------------------------ .. code-block:: xml ${company_name} Sales Performance Report — ${period}
${company_name} SALES PERFORMANCE REPORT
${period} Prepared by ${prepared_by} — ${report_date} ${total_revenue} Total Revenue ${yoy_growth} YoY Growth ${new_customers} New Customers ${avg_deal_size} Avg Deal Size Revenue & Regional Breakdown Monthly Revenue Trend Top Accounts AccountRevenueRegionStatus
${company_name} — Confidential — Internal Distribution Only
.. note:: ```` nests inside ```` like any other node -- the "Revenue & Regional Breakdown" section above places two independent charts (pie + histogram) side by side on one canvas by giving each its own ``x``. See :ref:`Combining Charts with Canvas ` for more on this pattern. Data — ``sales_report.json`` ------------------------------- .. code-block:: json { "company_name": "NorthWind Analytics", "period": "Q3 2025 Sales Performance", "prepared_by": "Sara Neri, VP Sales", "report_date": "2025-10-05", "total_revenue": "$1.84M", "yoy_growth": "+18.4%", "new_customers": "62", "avg_deal_size": "$14.2k", "revenue_split": [{"Hardware":32},{"Software":27},{"Services":18}, {"Support":13},{"Other":10}], "regional_sales": [{"N":210},{"S":340},{"E":180},{"W":295},{"C":260}], "trend_current": [[1,140],[2,152],[3,148],[4,165],[5,178],[6,171], [7,185],[8,198],[9,204]], "trend_prior": [[1,118],[2,122],[3,125],[4,130],[5,138],[6,142], [7,150],[8,155],[9,160]], "top_accounts": [ ["Acme Corporation", "$182,400", "East", "Active"], ["Globex Industries", "$156,900", "North", "Active"], ["Initech Solutions", "$134,250", "West", "Active"], ["Umbrella Manufacturing", "$121,800", "Central", "Renewal Due"], ["Stark Logistics", "$98,600", "South", "Active"] ] } Usage ----- .. code-block:: bash docraft_tool sales_report.craft output/sales_report.pdf --data sales_report.json Output Example -------------- KPI cards, the revenue/regional chart dashboard, and the start of the trend chart fill page 1; the rest of the trend chart and the top-accounts table carry onto page 2: .. image:: ../_static/sales_report_page1.png :alt: Sales Performance Report Example Output — page 1 :align: center :width: 550px .. image:: ../_static/sales_report_page2.png :alt: Sales Performance Report Example Output — page 2 :align: center :width: 550px