Graphs
Graph fields allow you to embed charts and visual data representations directly into your generated documents. Supported chart types include pie, bar, and stacked bar charts.
Syntax
Graph fields use a special directive that specifies the chart type, data source, and display options.
Template syntax
{{#graph type="pie" data="asset_allocation" labelKey="asset_class" valueKey="percentage"}}
{{/graph}}Supported chart types
- pie — circular chart showing proportional data. Ideal for asset allocation breakdowns.
- bar — vertical bar chart for comparing values across categories.
- stacked_bar — stacked bar chart for showing composition within categories.
Options
- type — the chart type (
pie,bar,stacked_bar). - data — the field name of the array to chart.
- labelKey — the property name used for labels.
- valueKey — the property name used for values.
- title — optional chart title displayed above the graph.
- showLegend — whether to display a legend (
true/false).
Chart sizing
Graphs are rendered as images in the final document. The size is determined by the placeholder area in your template file. For best results, use a full-width content area.
Example
Full example
{{#graph type="pie" data="asset_allocation" labelKey="asset_class" valueKey="percentage" title="Recommended Asset Allocation" showLegend="true"}}
{{/graph}}Graphs require numeric data in the
valueKey field. Ensure your data does not include currency symbols or percentage signs in the value — use raw numbers.