LibreOffice Calc · Charts and visualization · Intermediate
Create and interpret chart trendlines and error bars
A worked Calc example to create and interpret chart trendlines and error bars, with source checks, changed inputs and recovery.
Documentation-qualified for Calc 26.2; native workflow and persistence checks pending · Editorial standards
Use an XY scatter chart for a numeric regression equation, and distinguish the fitted line from the uncertainty bars around observations. A line chart’s category positions can silently replace your X measurements with 1, 2, 3 and so on.
Make a calibration fixture
Use LibreOffice Calc 26.2 desktop, English standard menus on Windows/Linux, and a disposable ODS workbook. The chart operations below follow the official guide; native execution and persistence are still unverified. These are synthetic measurements, not evidence about a real instrument.
On a sheet named Calibration, enter A1:C5:
| Input | Reading | Absolute uncertainty |
|---|---|---|
| 1 | 3 | 0.5 |
| 2 | 5 | 0.5 |
| 3 | 7 | 0.5 |
| 4 | 9 | 0.5 |
Select A1:B5 and choose Insert > Chart > XY (Scatter), with points rather than connecting lines. In Data Series, check one series with X values A2:A5 and Y values B2:B5. C2:C5 is not a second measurement series; it will supply error magnitudes. Name the axes Input and Reading and finish the wizard.
Each reading equals 2 × input + 1, so the expected fitted slope is 2, intercept 1, and coefficient of determination R² is 1. The known uncertainty interval for the first point is 2.5 to 3.5. These expectations test different chart features.
Insert the regression line
- Double-click the chart to enter edit mode and select its entire Reading series. Use the Formatting toolbar’s Select Chart Element list if necessary.
- Choose Insert > Trend Line and select Linear on the Type tab.
- Leave Force Intercept off; forcing zero would fit a different model from the one specified here.
- Enable Show Equation and Show Coefficient of Determination (R2). Give the line a meaningful name and confirm.
- Inspect the displayed equation for slope 2 and intercept 1. If decimals obscure a later result, right-click the equation and choose Format Trend Line Equation to increase number-format precision.
Do not select a high-degree polynomial just to obtain a visually perfect fit. The linear relationship was chosen from the fixture’s construction; a high R² alone does not justify extrapolation or prove causation. Leave forward/backward extrapolation at zero for this exercise.
Add specified uncertainty bars
With the Reading series still selected, choose Insert > Y Error Bars. Under Error Category, select Cell Range and set both positive and negative ranges to $Calibration.$C$2:$C$5. Select both directions under Error Indicator and confirm. Verify four vertical bars centered on the points, each extending 0.5 in either direction.
The cells contain magnitudes, not lower/upper endpoints. Entering 2.5 and 3.5 as the first point’s error magnitudes would be wrong. Nor are these bars automatically a 95% confidence interval for the regression. Their meaning comes from the supplied measurement-uncertainty specification.
Separate data changes from uncertainty changes
Change C5 from 0.5 to 1. Only the last bar should lengthen, spanning 8 to 10; the trend line should still be 2x + 1 with R²=1. Restore C5 to 0.5.
Now change B5 from 9 to 10. Independent least squares gives slope 2.3, intercept 0.5 and R² about 0.988785. The last error interval becomes 9.5 to 10.5. The specified bar size is unchanged even though the fitted relationship changed. Restore B5 to 9 and reconcile the original line.
Save and reopen the ODS, then inspect the source-role ranges, equation and error ranges. For numeric X values that are dates, consult the distinct date-axis scatter exercise.
Troubleshooting
A disabled Trend Line command usually means no data series is selected or the chart type does not support it. Pie, net, bubble and stock charts do not support these trend lines or error bars. If bars appear on every series, undo and select only the intended series before insertion. Use the series context menu’s Delete Y Error Bars to remove that overlay without deleting observations. Delete a selected trend line separately; do not erase the chart or source data to remove its statistical decoration.
Official references
Sources were captured on 20 October 2026 and reviewed from retained snapshots. All outcomes above are expected checks, not a claim of native execution.