<Chart> maps to Chart.js syntax and converts to a native PowerPoint chart.
Supported types are line, bar, area, scatter, pie, radar, bubble and waterfall. Combo charts, mixing line, bar and area in one chart, are also supported.
Components
<Chart>
The container. Type is set with type, and size and position with ordinary CSS, either in document flow or absolutely with box.
style.
<ChartTitle> and <Legend>
Both optional.
<XAxis> and <YAxis>
XAxis defaults to a category axis, YAxis to linear. Override with type.
JSON attributes use a single-quoted outer wrapper:
attr='{"key":"val"}'.
Number formatting gotchas. In
tickFormat, wrap alphabetic literals in quotes, because bare m, d, y, h, s, a and p are date and time tokens. For percentages use decimals with tickFormat=0%, so 0.08 renders as 8%.<Dataset>
Any attribute Chart.js accepts per point can take an array of values, one per data point. For bar charts,
position: insideEnd in dataLabels puts the label inside the bar rather than above it.
Colours
Theme variablesvar(--accent1) through var(--accent6) track the deck palette, so a theme change carries into the chart. Literal rgb() and hex values also work.
Defaults
Styling is optional throughout, and PowerPoint’s defaults apply when omitted: 1pt dark grey lines, dark grey text in the theme font, no gridlines.Examples
Line chart with a forecast series
null for gaps, a dashed forecast that continues from the last actual, and currency formatting in millions.
Stacked bar with data labels
stack ID on the datasets and stacked="true" on the value axis.
Pie
labels goes on <Chart> rather than on an axis.
Scatter and bubble
scatter type with a third value per point for the radius: data="[[0.7, 2.7, 10], [1.8, 3.2, 4]]".
Chart variations
Waterfall
A single series showing deltas from a starting value. Bars listed insubtotals are absolute and anchored to zero; everything else floats as a delta.
formatOverrides on the chart, or style individual bars with pointOverrides on the dataset.
Combo charts
Combos mixline, bar and area. Instead of one type on <Chart>, each type gets a <Plot> with its datasets nested inside.
For a secondary axis, mark the second <YAxis> with secondary="true" (it moves to the right) and set axis="secondary" on the datasets that belong to it.