Skip to content

Charts

Create native PowerPoint charts that are editable in PowerPoint.

Chart Types

CategoryTypes
Standardbar, col, line, pie, area, scatter, doughnut, radar, bubble, stock, surface
3Dbar3D, col3D, line3D, pie3D, area3D

Column Chart

typescript
slide.addChart('col', {
  categories: ['Q1', 'Q2', 'Q3', 'Q4'],
  series: [
    { name: '2024', values: [120, 180, 150, 210], color: '4472C4' },
    { name: '2025', values: [140, 200, 190, 250], color: 'ED7D31' },
  ],
}, { x: 1, y: 1, w: 8, h: 5, title: 'Revenue', showLegend: true });
Column chart output
Column chart output

Pie Chart

typescript
slide.addChart('pie', {
  categories: ['Product A', 'Product B', 'Product C'],
  series: [{ name: 'Share', values: [45, 30, 25] }],
}, { x: 2, y: 1.5, w: 6, h: 5 });
Pie chart output
Pie chart output

Line Chart

typescript
slide.addChart('line', {
  categories: ['Jan', 'Feb', 'Mar', 'Apr'],
  series: [
    { name: 'Trend A', values: [10, 20, 15, 25] },
    { name: 'Trend B', values: [5, 15, 20, 18] },
  ],
}, { x: 1, y: 1, w: 8, h: 5, showDataLabels: true, showLegend: true });
Line chart output
Line chart output

Scatter Chart

typescript
slide.addChart('scatter', {
  xValues: [1, 2, 3, 4, 5],
  series: [
    { name: 'Measurements', values: [2.1, 3.8, 3.2, 4.5, 5.1] },
  ],
}, {
  x: 1, y: 1, w: 8, h: 5,
  scatterStyle: 'lineMarker',
  catAxis: { title: 'X' },
  valAxis: { title: 'Y' },
});

Radar Chart

typescript
slide.addChart('radar', {
  categories: ['Speed', 'Reliability', 'Comfort', 'Safety', 'Efficiency'],
  series: [
    { name: 'Model A', values: [4, 3, 5, 4, 3] },
    { name: 'Model B', values: [3, 5, 3, 5, 4] },
  ],
}, { x: 1, y: 1, w: 6, h: 5, radarStyle: 'filled', showLegend: true });
Radar chart output
Radar chart output

3D Column Chart

typescript
slide.addChart('col3D', {
  categories: ['Q1', 'Q2', 'Q3', 'Q4'],
  series: [{ name: 'Sales', values: [100, 150, 130, 180], color: '4472C4' }],
}, {
  x: 1, y: 1, w: 8, h: 5,
  view3D: { rotX: 15, rotY: 20, perspective: 30 },
});

Chart Options

OptionTypeDescription
x, ynumberPosition in inches
w, hnumberSize in inches (default: 6x4)
titlestringChart title
showLegendbooleanShow legend
legendPositionstring'b', 't', 'l', 'r', 'tr'
showDataLabelsbooleanShow data labels on points
showGridLinesbooleanShow grid lines
barGroupingstring'clustered', 'stacked', 'percentStacked'
catAxisAxisOptionsCategory axis config (title, format, min/max)
valAxisAxisOptionsValue axis config
view3Dobject3D rotation and perspective

See ChartOptions, AxisOptions for the full reference.

Series Options

OptionTypeDescription
namestringSeries name
valuesnumber[]Data values
colorColorSeries color (hex string or color object)
colorsColor[]Per-data-point colors (e.g. pie slices)
markerChartMarkerOptionsData point markers (line/scatter)
trendlineTrendlineOptionsAdd a trendline (linear, exp, log, etc.)
errorBarsErrorBarOptionsError bar display
smoothbooleanSmooth line interpolation
opacitynumberSeries opacity (0–100)

See ChartSeries for the full reference.

Released under the MIT License.