Overview
Line charts show trends over time and are essential for growth metrics, financial data, and performance tracking. The pptx.dev API supports basic lines, lines with markers, multi-series lines, stacked lines, and lines with high-low bands.
Line Chart Types
| Chart type | Description |
|---|---|
LINE |
Basic line chart |
LINE_WITH_MARKERS |
Line with data point markers |
LINE_WITH_HIGH_LOW |
Line with a high/low range band |
LINE_WITH_HIGH_LOW_AND_MARKERS |
High/low band with markers |
LINE_2X |
Two-series line chart |
LINE_WITH_MARKERS_2X |
Two series with markers |
LINE_3X |
Three-series line chart |
STACKED_LINE_2X |
Two-series stacked line |
STACKED_LINE_3X |
Three-series stacked line |
Example: Monthly Revenue Trend
{
"$schema": "https://openpresentation.org/schema/opf/v1",
"name": "Monthly Revenue Trend",
"slides": [
{
"layout": "chart-1x-title-center",
"title": "Monthly Revenue Trend",
"chart": {
"type": "line-with-markers",
"data": {
"columns": [
"Series",
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun"
],
"rows": [
[
"Revenue ($K)",
120,
135,
128,
155,
170,
195
]
]
}
},
"design": {
"titleAlignment": "center",
"contentAlignment": "center"
}
}
],
"catalogs": {
"layouts": {
"records": [
{
"$schema": "https://openpresentation.org/schema/opf-layout/v1",
"id": "chart-1x-title-center",
"name": "Chart 1x Title Center",
"placeholders": [
{
"type": "title"
},
{
"type": "chart"
}
]
}
]
}
}
}
Example: Multi-Channel Comparison
Use LINE_3X to compare trends across multiple dimensions:
{
"$schema": "https://openpresentation.org/schema/opf/v1",
"name": "Traffic by Channel",
"slides": [
{
"layout": "chart-1x-title-center",
"title": "Traffic by Channel",
"chart": {
"type": "line-with-markers-3x",
"data": {
"columns": [
"Series",
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun"
],
"rows": [
[
"Organic",
4200,
4800,
5100,
5600,
6200,
7000
],
[
"Paid",
3100,
3400,
3200,
3800,
4100,
4500
],
[
"Referral",
800,
900,
1100,
1200,
1400,
1600
]
]
}
},
"design": {
"titleAlignment": "center",
"contentAlignment": "center"
}
}
],
"catalogs": {
"layouts": {
"records": [
{
"$schema": "https://openpresentation.org/schema/opf-layout/v1",
"id": "chart-1x-title-center",
"name": "Chart 1x Title Center",
"placeholders": [
{
"type": "title"
},
{
"type": "chart"
}
]
}
]
}
}
}
Example: Line with High-Low Band
Show a metric with its confidence interval or range:
{
"$schema": "https://openpresentation.org/schema/opf/v1",
"name": "Response Time (p50 with p10–p90 band)",
"slides": [
{
"layout": "chart-1x-title-center",
"title": "Response Time (p50 with p10–p90 band)",
"chart": {
"type": "line-with-high-low-and-markers",
"data": {
"columns": [
"Series",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"rows": [
[
"p50 (ms)",
45,
42,
48,
44,
41
],
[
"p90",
120,
110,
135,
115,
105
],
[
"p10",
12,
10,
15,
11,
9
]
]
}
},
"design": {
"titleAlignment": "center",
"contentAlignment": "center"
}
}
],
"catalogs": {
"layouts": {
"records": [
{
"$schema": "https://openpresentation.org/schema/opf-layout/v1",
"id": "chart-1x-title-center",
"name": "Chart 1x Title Center",
"placeholders": [
{
"type": "title"
},
{
"type": "chart"
}
]
}
]
}
}
}
When to Use Line Charts
| Use case | Chart type |
|---|---|
| Single metric trend | LINE or LINE_WITH_MARKERS |
| Comparing 2-3 trends | LINE_2X or LINE_3X |
| Showing ranges/bands | LINE_WITH_HIGH_LOW |
| Cumulative totals | STACKED_LINE_2X/3X |
Line vs. Column
- Use line charts when the x-axis represents time and you want to emphasize the trend.
- Use column charts when comparing discrete categories or when the exact values matter more than the trend.
Next Steps
- Add composition views with pie and doughnut charts
- Explore specialty charts like waterfall and funnel
- See all chart types