Skip to content

Charts

SlideSpeak supports bar, line, pie, and doughnut charts. Create charts automatically with the /generate endpoint or manually with full control using /generate/slide-by-slide.


SlideSpeak supports the following chart types:

  • BAR - Vertical bar chart for comparing values across categories
  • STACKED_BAR - Stacked column chart for showing how sub-categories contribute within each bar
  • HORIZONTAL_BAR - Horizontal bar chart for comparing values
  • LINE - Line chart for showing trends over time
  • PIE - Pie chart for showing proportions of a whole
  • DOUGHNUT - Doughnut chart (pie chart with a hole in the center)

The /generate endpoint can automatically generate charts from your content. Simply provide textual or numerical data in your prompt, and if the AI detects that a chart would be an effective way to present the information, it will automatically create one.

Terminal window
curl -X POST https://api.slidespeak.co/api/v1/presentation/generate -H "Content-Type: application/json" -H "X-API-Key: <YOUR_API_KEY>" -d '{
"plain_text": "Create a presentation about our company performance. Our revenue for 2024 was: Q1: $45,000, Q2: $52,000, Q3: $61,000, Q4: $58,000. Show this data in a chart to visualize our quarterly performance.",
"template": "DEFAULT",
"length": 3
}'

Using Charts with /generate/slide-by-slide

Section titled “Using Charts with /generate/slide-by-slide”

The /generate/slide-by-slide endpoint gives you full control over chart structure. You can specify the exact data, labels, and styling for your charts.

When using the slide-by-slide endpoint, each chart slide must include:

  • layout - Must be set to CHART
  • title - The title of the slide
  • item_amount - Should be set to 0 for chart slides
  • content - A description of the chart (used only if chart is not provided; the AI will generate a chart from this text)
  • chart - The chart object (see structure below). If omitted, a chart will be automatically generated from the content field

The chart object has the following structure:

{
"type": "BAR | STACKED_BAR | HORIZONTAL_BAR | LINE | PIE | DOUGHNUT",
"name": "Chart Title",
"data": {
"labels": ["Label1", "Label2", "Label3"], // x-axis labels or pie slice labels
"datasets": [
{
"label": "Dataset Name", // series name (appears in legend)
"data": [10, 20, 30] // numeric values (must match labels length)
}
],
"xAxisLabel": "X-Axis Label", // empty string for pie/doughnut charts
"yAxisLabel": "Y-Axis Label" // empty string for pie/doughnut charts
}
}
Terminal window
curl -X POST https://api.slidespeak.co/api/v1/presentation/generate/slide-by-slide -H "Content-Type: application/json" -H "X-API-Key: <YOUR_API_KEY>" -d '{
"template": "DEFAULT",
"slides": [
{
"title": "Quarterly Revenue",
"layout": "CHART",
"item_amount": 0,
"content": "Revenue performance across quarters",
"chart": {
"type": "BAR",
"name": "Quarterly Revenue",
"data": {
"datasets": [
{
"label": "Revenue",
"data": [45000, 52000, 61000, 58000]
}
],
"labels": ["Q1", "Q2", "Q3", "Q4"],
"xAxisLabel": "Quarter",
"yAxisLabel": "Revenue ($)"
}
}
}
]
}'

  • Bar/Horizontal Bar Charts - Best for comparing values across different categories
  • Stacked Bar Charts - Ideal when you want to compare both category totals and how smaller segments contribute to each total
  • Line Charts - Ideal for showing trends and changes over time
  • Pie/Doughnut Charts - Perfect for showing proportions and percentages of a whole
  • Keep datasets clear and focused - avoid overcrowding charts with too many data points
  • Use descriptive labels that clearly identify what each data point represents
  • Provide meaningful axis labels to help your audience understand the scale and units
  • For pie/doughnut charts, limit the number of segments to 5-7 for better readability

You can include multiple datasets in bar and line charts to compare different series of data. Each dataset should have:

  • A unique, descriptive label
  • The same number of data points as there are labels